Why do I receive a Java exception when starting MATLAB 7.0.4 (R14SP2)?

1 view (last 30 days)
During a Simulink simulation, MATLAB crashed and when I tried to start MATLAB again, I received a Java exception. Before everything worked fine. I would like to know how to renew the setup of my system and to get MATLAB running.
The error message follows.
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.mathworks.mde.filebrowser.FileViewTableModel$FileInfoItem.appendMDLDescription(FileViewTableModel.java:748)
at com.mathworks.mde.filebrowser.FileViewTableModel$FileInfoItem.getMdlH1Line(FileViewTableModel.java:670)
at com.mathworks.mde.filebrowser.FileViewTableModel$FileInfoItem.getH1Line(FileViewTableModel.java:406)
at com.mathworks.mde.filebrowser.FileViewTableModel$FileInfoItem.getDisplayedData(FileViewTableModel.java:331)
at com.mathworks.mde.filebrowser.FileViewTableModel.getValueAt(FileViewTableModel.java:169)
at com.mathworks.mde.filebrowser.FileViewSortDecorator.getValueAt(FileViewSortDecorator.java:244)
at javax.swing.JTable.getValueAt(Unknown Source)
at javax.swing.JTable.prepareRenderer(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
........

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 2 May 2012
Occasionally, when MATLAB crashes, some files in the MATLAB preferences directory do not close properly and cause the Java exception during MATLAB restart.
To resolve this issue:
1. Rename the MATLAB preferences directory. Locate this directory by running
prefdir
in the MATLAB Command Window.
2. Restart MATLAB. A new preferences directory will be created.
3. If you would like to restore information in certain preference files, you can overwrite files in the newly formed preferences directory with the same files from the old directory content. For example the file 'history.m' contains the MATLAB Command History.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R14SP2

Community Treasure Hunt

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

Start Hunting!