I am having problems having my Java programs see classes that are packaged in an external jar. I am running under Windows 7. I have the classes embedded in a jar called ParserUtilities.jar. I established the path with a CLASSPATH variable using the System utility and the Environment tab. I confirmed that the CLASSPATH is set correctly. When I type echo %CLASSPATH%, I see C:\Program Files\Java\externaljars\ParserUtilities.jar which is correct. But when I type java -jar Parse.jar (my executable) I get the error Exception in thread "main" java.lang.NoClassDefFoundError: com/artificialmed/Initialize
Some additional information:
- When I put the ParserUtilities.jar in the ..\lib\ext directory, everything works.
- I am running java version 1.6.0_16. Java(TM) SE Runtime Environment
- In experimenting, I typed java -cp C:\Program Files\Java\jre6\lib\ext>java -cp C:\Program Files\Java\externaljars\ParserUtilities.jar
and got this error "Could not find the main class: Files\Java\externaljars\ParserUtilities.jar" but there is no main class (its just a collection of classes I use in a bunch of programs).
I do not have a Java SDK loaded in the environment, just a java JRE (Is this the issue?).