WebObjects 5.2: Fixing a java.lang.NoClassDefFoundError exception after upgrading to Mac OS X 10.3

Learn how to set the correct JVM in a WebObjects application that failed to run with a java.lang.NoClassDefFoundError exception. This would occur when using WebObjects 5.2.2 after an upgrade to Mac OS X 10.3.
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:
  1. Open the application with Xcode.
  2. Expand the "Targets" column on the left.
  3. Select the main project target. For example, if the main project is named "MyApp", select "MyApp" target.
  4. Double-click the project target to get the Settings display.
  5. Select Expert View.
  6. Set the correct value for the JAVA_VM variable:
  7. 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.
Published Date: Oct 7, 2016