Navigation

Operators and Keywords

Function List:

C++ API

: javachk (feature)
: javachk (feature, component)
: msg = javachk (…)

Check for the presence of the Java feature in the current session and print or return an error message if it is not.

Possible features are:

"awt"

Abstract Window Toolkit for GUIs.

"desktop"

Interactive desktop is running.

"jvm"

Java Virtual Machine.

"swing"

Swing components for lightweight GUIs.

If feature is supported and

  • no output argument is requested:

    Return an empty string

  • an output argument is requested:

    Return a struct with fields "feature" and "identifier" both empty

If feature is not supported and

  • no output argument is requested:

    Emit an error message

  • an output argument is requested:

    Return a struct with field "feature" set to feature and field "identifier" set to component

The optional input component will be used in place of feature in any error messages for greater specificity.

javachk determines if specific Java features are available in an Octave session. This function is provided for scripts which may alter their behavior based on the availability of Java. The feature "desktop" is never available as Octave has no Java-based desktop. Other features may be available if Octave was compiled with the Java Interface and Java is installed.

See also: usejava, error.

Package: octave