Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

javachk

Error message based on Java feature support

Syntax

Description

example

MSG = javachk(feature) returns a generic error message if the specified Java® feature is not available in the current MATLAB® session.

example

javachk(feature,component) also names the specified component in the error message.

Examples

collapse all

if isempty(javachk('jvm'))
   scalar = java.lang.Double(5);
end
% Check that JVM is available & JavaFigures are supported
error(javachk('jvm'))
error(javachk('awt'))

Write a script, myFile, that displays a Java Frame.

error(javachk('awt','myFile'))
myFrame = java.awt.Frame;
myFrame.setVisible(1)

If the script cannot display a frame, it displays this error:

myFile is not supported on this platform.

Input Arguments

collapse all

Java feature, specified as one of these values:

'awt'

UI components in the Java Abstract Window Toolkit (AWT) are available.

'desktop'

MATLAB interactive desktop is running.

'jvm'

Java Virtual Machine software (JVM™) is running.

'swing'

Swing components (Java lightweight UI components in the Java Foundation Classes) are available.

Identifier, specified as a character vector, to display in the error message.

Data Types: char

Output Arguments

collapse all

Error message, returned as a structure with the following fields. If the feature is available, javachk returns an error structure with empty fields.

Message, specified as a character vector.

Identifier, specified as a character vector.

See Also

|

Introduced before R2006a

Was this topic helpful?