Running a WebObjects application that was created on an earlier system can produce an immediate java.lang.NoClassDefFoundError exception upon launch. This will happen even after the project is rebuilt on a Mac OS X 10.3 system.
To check that the proper JVM is set:
- Open the application with Xcode.
- Expand the "Targets" column on the left.
- Select the main project target. For example, if the main project is named "MyApp", select "MyApp" target.
- Double-click the project target to get the Settings display.
- Select Expert View.
- Set the correct value for the JAVA_VM variable:
- JAVA_VM = java
The reason is that the JVM version was hard-coded into a variable in the project. After upgrading to Mac OS X 10.3, the default JVM, as defined in the project, has not changed and still points to the older JDK 1.3.1 with the following value:
JAVA_VM = /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Commands/java
Setting the JAVA_VM to the correct value will fix the runtime error. Please note that Mac OS X 10.3 requires JDK 1.4.1.