Why do I receive Java errors when I try to edit any MATLAB file in MATLAB 7.1 (R14SP3)?

I am trying to open an MATLAB file named 'test.m' as follows:
edit test.m
MATLAB does not open the file and I receive following errors in the MATLAB command window:
java.lang.NoClassDefFoundError: org/openide/ErrorManager
at org.netbeans.editor.Utilities.<clinit>(Utilities.java:78)
at org.netbeans.editor.BaseTextUI.installUI(BaseTextUI.java:187)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.text.JTextComponent.setUI(Unknown Source)
at com.mathworks.widgets.SyntaxTextPaneBase.setUI(SyntaxTextPaneBase.java:1019)
at org.netbeans.editor.BaseKit.install(BaseKit.java:483)
at javax.swing.JEditorPane.setEditorKit(Unknown Source)
at javax.swing.JEditorPane.setContentType(Unknown Source)
at com.mathworks.widgets.SyntaxTextPane.<init>(SyntaxTextPane.java:332)
at com.mathworks.mde.editor.EditorSyntaxTextPane.<init>(EditorSyntaxTextPane.java:26)
<SNIP>

 Accepted Answer

The issue is that the JAR file containing a Java class required for the Editor is not on the class path. To verify this is the issue, execute the JAVACLASSPATH command at the MATLAB prompt as follows:
javaclasspath
Check that the path includes $MATLAB/java/jar/org/openide.jar entry (where $MATLAB is the MATLAB root directory on your machine, as returned by typing 'matlabroot' at the MATLAB Command Prompt). If the javaclasspath does not include the path for openide.jar file, you will need to add this JAR file to the path using the JAVAADDPATH function as follows:
javaaddpath('$MATLAB/java/jar/org/openide.jar')
Another possibility is that this particular JAR file is missing. Please verify that the openide.jar file exists in the following folder:
$MATLAB/java/jar/org/

More Answers (0)

Products

Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!