Java package

From Octave
Revision as of 17:10, 3 February 2016 by Carandraug (talk | contribs) (remove the whole FAQ section which is part of the Octave manual)
Jump to navigation Jump to search
Warning icon.svg
This package is not required for Octave versions 3.8.0 or later. Since Octave 3.8.0, Java support is part of Octave core. Do not install this package as it will shadow core functions. However, even for those versions, Octave needs to have been built with java support (run octave_config_info ("JAVA")). If it didn't, you'll have to rebuild Octave from source with that option.

Octave is an easy to use but powerful environment for mathematical calculations, which can easily be extended by packages. Its features are close to the commercial tool MATLAB so that it can often be used as a replacement. Java on the other hand 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. This document refers to the package java, which is part of the GNU Octave project. This package allows you to access Java classes from inside Octave. Thus it is possible to use existing class files or complete Java libraries directly from Octave.

This description is based on the Octave package java-1.2.8; however many items are equally valid for the built-in Java support in Octave-3.8.0 and higher.. The java package usually installs its script files (.m) in the directory .../share/Octave/packages/java-1.2.8 and its binary (.oct) files in .../libexec/Octave/packages/java-1.2.8. You can get help on specific functions in Octave by executing the help command with the name of a function from this package:

octave> help javaObject

You can view the whole doc file in Octave by executing the info command with just the word java:

octave> doc java

Note on calling Octave from Java: the java package is designed for calling Java from Octave. If you want to call Octave from Java, you might want to use a library like javaOctave or joPas.