MATLAB Function Reference    

Generate an error message based on Java feature support



javachk(feature) returns a generic error message if the specified Java feature is not available in the current MATLAB session. If it is available, javachk returns an empty matrix. Possible feature arguments are shown in the following table.

Abstract Window Toolkit components1 are available.
The MATLAB interactive desktop is running.
The Java Virtual Machine is running.
Swing components2 are available.

1. Java's GUI components in the Abstract Window Tookit

2. Java's lightweight GUI components in the Java Foundation Classes

javachk(feature, component) works the same as the above syntax, except that the specified component is also named in the error message. (See the example below.)


The following M-file displays an error with the message "CreateFrame is not supported on this platform." when run in a MATLAB session in which the AWT's GUI components are not available. The second argument to javachk specifies the name of the M-file, which is then included in the error message generated by MATLAB.

See Also


  javaArray javaMethod