install4j and Java for Mac OS X v10.5 Update 4

Thursday, June 18, 2009 | Posted by

Unfortunately the latest release of Java 6 on Mac OS X a few days ago broke all installers on Mac OS X that require Java 6 as a minimum Java version.

This is why we have sped up our release schedule for 4.2.3 and we pushed out the release today.

The error message you get with installers that are generated by older versions of install4j is:
 
Java application launched from PPC or bad stub. Relaunching in 32-bit, and tagging sub-processes to prefer 32-bit with $JAVA_ARCH=i386.
[JavaAppLauncher Error] This process is [i386] and was re-exec'd from [i386], but for some reason we are trying re-exec to [].
How could this happen? The explanation goes like this: Installers on Mac OS X ship their own binary Java application stub. Prior to Java 6 this application stub only contained 32-bit executables for PPC and Intel architectures. So far, Java 6 is only available on 64-bit Intel machines. From the beginning, the 32-bit stub continued to work with Java 6. This behavior was changed in Java for Mac OS X v10.5 Update 4, so we had to add a 64-bit executable to the Java application stub.

If you're on an older version of install4j and cannot update to the latest version for whatever reason, you can copy the file $INSTALL4J_HOME/resource/macos/JavaApplicationStub from a 4.2.3 installation to your older installation.

5 comments

  1. the new update also breaks applications that rely on 32 bit libraries.

    32 bit applications can however work in 32 bit mode if you pass the -d32 option with the java invocation. unfortunately i have specified this in my java invocation and it still doesn't work.

    mac applications can run in 32 bit mode if you open the "Get Info" and select the "Run in 32 bit mode" option. does install4j provide any method for setting this?

    ReplyDelete
  2. Jay: Thanks for pointing this out. This is indeed rather unfortunate. The easiest workaround is to replace the stub in install4j/resource/macos with the older version. You can download it here:

    http://download.ej-technologies.com/install4j/JavaApplicationStub

    As there is no 32-bit Java 6 JVM available on OS X, the problems with the old stub won't matter when you require a 32-bit VM.

    We will have an option in the next bugfix release.

    ReplyDelete
  3. FYI, other approaches I've found to work are to run a script which executes

    "lipo -remove x86_64 Your.app/Contents/MacOS/JavaApplicationStub
    -output Your.app/Contents/MacOS/JavaApplicationStub"

    on the new stub after installation or to specify the JVMArchs key under the Java subitem in the Info.plist file. This is deprecated by Apple but works (in some cases it's the only thing that works) at least for the time being.

    I've also found that the execute launcher action no longer works. I know that this isn't the forum for support so I've filed a bug report.

    ReplyDelete
  4. hi,

    I've tried the updater feature of install4j and the default stand alone updater returns an error "The System cannot find the path specified." to the updater error log file. I'm calling the updater from my application by "ApplicationLauncher.lauchApplication(applicationID, null, false, callback);". What can I be doing wrong, anyone with the same problem?

    Thanks

    ReplyDelete
  5. André: I have not seen this problem before, but I'm sure we can sort it out. Please contact me at ingo.kegel@ej-technologies.com with a screenshot of that error and any stack trace that is printed on stderr.

    ReplyDelete