Java package: Difference between revisions

From Octave
Jump to navigation Jump to search
(reorganize text -- make clear separation between what happens for each octave version and remove some useless sales pitch)
m (Remove redundant Category:Packages.)
 
(6 intermediate revisions by 4 users not shown)
Line 9: Line 9:
However, even for these versions, Octave needs to have been built with java support. Check it like so:
However, even for these versions, Octave needs to have been built with java support. Check it like so:


   >> octave_config_info ("features").JAVA
   >> (str2num(strtok(version(), '.')) > 4 && __octave_config_info__("JAVA")) || octave_config_info ("features").JAVA
   ans =  1
   ans =  1


Line 23: Line 23:




[[Category:Octave-Forge]]
[[Category:Octave Forge]]

Latest revision as of 11:15, 10 June 2019

Java offers a rich, object oriented, and platform independent environment for many applications. The core Java classes can be easily extended by many freely available libraries. GNU Octave has a java interface that allows access to Java classes from inside Octave. Thus it is possible to use existing class files or complete Java libraries directly from Octave.

Octave 3.8 or later[edit]

Warning icon.svg
Do not install the java package in Octave version 3.8.0 or later.

GNU Octave 3.8.0 incorporated the Octave Forge java package so the package is no longer necessary. If the package is installed, it will shadow the core functions making the java interface unreliable.

However, even for these versions, Octave needs to have been built with java support. Check it like so:

 >> (str2num(strtok(version(), '.')) > 4 && __octave_config_info__("JAVA")) || octave_config_info ("features").JAVA
 ans =  1

If your installation of Octave does not have java support, it needs to be rebuilt from source. See the pages specific to your Operating System for further details.

Documentation[edit]

See the Java Interface section of the Octave manual.

Legacy versions -- Octave 3.6 and older[edit]

Older versions of Octave did not have a native java interface. Instead, the Octave Forge java package was required. This needed to be installed separately via pkg. To install, download the java package and install it with pkg install path-to-java.tar.gz