Here you can find answers to some of the errors you may encounter while using njTBX. If you still having trouble, then send your questions to njtbx-users list.
- I am getting 'Arguments to IMPORT must either end with ".*"' error ?
- What is 'java.lang.OutOfMemoryError' error ?
- What does 'Not Clearing Java' message means ?
- Unable to see help documentation and demos within matlab ?
- I am getting 'Arguments to IMPORT must either end with ".*"' error ?

- The full extent of the error would be something like this as shown below.
??? Error: File: /home/username/<M-file_name>
Line: 1651 Column: 8
Arguments to IMPORT must either end with ".*"
or else specify a fully qualified class name:
"<class_name>" fails this test.
- This error usually occurs because the the import statement is referencing a Java™ class (<class_name>) that it cannot find at run time. In order to fix this problem try the following fixes in order.
- Check to see if the JAR file(s) that contains the Java class is stored in a directory that is on the Java class path. On Matlab prompt, type
>>javaclasspath
...
DYNAMIC JAVA PATH
<your_directory_path_for_jar_files>/toolsUI-<version>.jar
<your_directory_path_for_jar_files>/njTools-<version>.jar
If the 'DYNAMIC JAVA PATH' does not display the correct path or jar entries, then see setup to add jar files to matlab classpath. Also, make sure that you do not have any older version toolsUI/njTools jar files in your classpath.
- Check your java runtime version on your matlab. You should have version 1.5 or higher for toolbox to work properly. On Matlab prompt, type
>>version -java
ans =
Java 1.6.0_04-b12 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
- Check to see if you have downloaded the correct 'njTools.jar' file corresponding to the java version you have on your machine.
- Check to see if 'jvm' (Java Virtual Machine) is running on your system. On Matlab prompt, type
>>usejava('jvm')
'1' - running '0' - not running
If '0', then check matlab starup options to see if '-nojvm' switch is on. If 'on', then set it to off and restart matlab.
- Check to see if the jar files (toolsUI/njTools) are not corrupted or resulted in incomplete download.
- What is 'java.lang.OutOfMemoryError' error ?

- The full extent of the error would be something like this as shown below.
Java exception occurred:
java.lang.OutOfMemoryError: Java heap space
The error with Java heap space is due to the default virtual memory settings for java in matlab. You will have to change the virtual memory settings on your machine. Follow the steps below.
1. Create a file name 'java.opts' with these lines
-Xms312m
-Xmx896m
Depending upon the memory specifications of your machine you can set the max runtime memory i.e. -Xmx settings. Right now it's set to '896mb'.
2. Save 'java.opts' file in your
$MATLABROOT/bin/$ARCH
where,
$MATLABROOT can be known by typing in matlab
>>matlabroot
$ARCH can be know by typing in matlab
>>computer('arch')
After you save the file, restart matlab. Then type
>> java.lang.Runtime.getRuntime.maxMemory
It should say (depending on your new memory settings)
ans =
916062208
3. If for some reason (admin rights etc.) you cannot save 'java.opts' file in matlab root directory,
then save the java.opts file in matlab startup directory (i.e. where you are running your matlab) and restart matlab.
- What does 'Not Clearing Java' message means ?

- If older class object(s) still exist and is different from newer object(s) (with same class name)then this error will occur. In order to clear old objects, type
>>clear classes
- Unable to see help documentation and demos within matlab ?

- In order for help and demos to work within matlab, make sure the NJ toolbox root directory (say $njtbxroot) and '$njtbxroot/examples' are in matlab search path. Run '$njtbxroot/njtbxpath.m' script to know the required path(s) to be added to the matlab search path.
|