X

Java applications broken after Java Update 2 (OS X 10.5), Release 7 (OS X 10.4)

Many users who have installed the latest Java updates from Apple (Java Update 2 for Mac OS X 10.5.x and release 7 for Mac OS X 10.4) are experiencing a problem in which many, if not all, of their Java applications do not run.

CNET staff
3 min read

Many users who have installed the latest Java updates from Apple (Java Update 2 for Mac OS X 10.5.x and release 7 for Mac OS X 10.4) are experiencing a problem in which many, if not all, of their Java applications do not run.

Apple Discussions poater liam110:

"I just downloaded/installed the latest Java update. jEdit, JDiskReport, jDiskUsage - the list goes on - all my Java apps fail."

Users have tried downloading and reapplying the latest Java updates with no success. In addition, running permissions fixes and other maintenance scripts are ineffective. Based on user investigation, it appears that this problem is caused by a failure in a symbolic link within the application package to the executable Java system resources on the hard drive.

In native OS X applications, the application package contains the executable file buried in a folder structure as follows:

  • Appname.app/Contents/MacOS/appname

While in most OS X applications the "appname" is the executable binary file that runs, for Java applications that are packaged in ".app" format this is a link to the executable at the following path on the hard drive:

/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub

(NOTE: For 64-bit applications the path is the same, but the executable file is "JavaApplicationStub64")

If the link to this file is not working, then the applications will not start correctly. As such, users have fixed this problem by bypassing the symbolic link in the affected Java applications. In addition to this fix, there are several possible workarounds for this problem.

Workarounds

Redownload the affected application Users might first try downloading either the current version or an update of the affected Java application. Users with fully updated systems have been able to successfully download and run the applications that are causing problems for others, and as such it is possible a freshly downloaded application package could contain intact links to the "JavaApplicationStub" file. Redownloading the application may get the links working again.

Use the .jar version of the application While OS X supports bundled java applications for portability and simplicity, most come in nonpackaged "jar" format as well, and run just as well as the packaged version. The only difference is support files may be placed in various locations in the user's home folder, and the application itself will have application resources in folders and subdirectories around it instead of bundled in the .app file.

Fixes

Bypass the links in the Java applications Instead of having the application target the "JavaApplicationStub" system resources via links, copy the resource directly to the application. To do this, in a Finder window navigate to the following directory:

/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/

Then right-click the "JavaApplicationStub" file and choose "Copy 'JavaApplicationStub'" from the contextual menu or highlight the file and press command-C.

Then locate and right-click the problematic java application and choose "Show Package Contents" from the contextual menu. Navigate to the /Contents/MacOS/ folder and there should be an alias file with the name of the application in lowercase letters. Drag that file to the trash, and then press command-V to paste (copy) the "JavaApplicationStub" file to the current folder that contained the alias. Rename the copied "JavaApplicationStub" file to the same, lowercase name as the trashed alias, and then close the Finder window and try opening the application. This should fix the problem.

Users might be tempted to create an alias of the "JavaApplicationStub" file and copy that to the application contents folder, but this will not work and will give an error about unsupported architecture. In order to recreate the link, users must create a "symbolic link", which has subtle differences to aliases, but given that the "JavaApplicationStub" file is only 60KB, copying it to affected applications as described should suffice.

Resources

  • liam110
  • More from Late-Breakers