help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java and Octave


From: Philip Nienhuis
Subject: Re: Java and Octave
Date: Fri, 15 Mar 2013 13:35:02 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

Jaya wrote:

    Jaya wrote
     > The requirement is to use the java interface, connect to octave,
    so that
     > octave processes the images.
     > The programs are to be distributed and run on systems without
     > octave installations.
     >
     > Kindly advice on how to invoke octave function from java.

    I'm not sure what you want as you didn't describe in sufficient
    detail what
    you have tried yourself, so below is a bit of a guess.

    If you need to invoke Java methods from Octave, you must add the
    directories
    where these methods are (in .java files), and/or add the Java class libs
    containing these methods (in .jar files), to the javaclasspath.
    Before you can do that you'd need to load the Java package (" pkg load
    Java").

    Type (from Octave) "help javaclasspath" and "help javaaddpath" for more
    info.

    But if you want to invoke Octave from Java, you need another strategy.

    Philip


In more detail,

gui.java has only the user interfaces required, which has a couple of
canvas and button objects. The user provides input parameters and images
in the java file. these inputs are to be passed over to octave, when the
user clicks a button called 'process'. the octave does the image
processing and generates the output. this generated output has to be
send back to java interface to be displayed by the user.

So do you hav a Java program that calls Octave, or do you want to run the Java GUI from Octave?
From what I read I suppose the former.

the java class files and the octave m files are to be bundled for
distribution even on non-java, non-octave installed systems. i am
assuming only jvm to be present on the client machine.

There you go, this isn't possible.
You just can't invoke .m files without having Octave around.
The JVM is part of Java - if the client machine has no Java there's no JVM either.

Perhaps you've confused a JRE and a JDK.
A Java JRE is just the Java runtime (incl. JVM) needed to run Java programs. A Java JDK is a Development Kit meant to create Java programs; a JDK includes a JRE. What may have confused you is that in order to install the Octave Java package a JDK is needed, not just a JRE. But to just run the Octave Java package a Java JRE will suffice.

Philip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]