Discussion:
Run your WO apps on Leopard Server (Intel) with Java 6
Brendan Duddridge
2009-09-01 18:31:20 UTC
Permalink
Hey WO Folks,

So I had a class version mismatch exception when building from Snow
Leopard (JDK 1.6) and deploying on Leopard Server (JDK 1.5). So I
wanted to switch my servers to use JDK 1.6 by default. Nothing we
tried would make that happen. We tried dragging the Java 6 entry in
Java Preferences up to the top of the list and rebooting the Xserve,
but that still didn't work. We also tried changing the CurrentJDK to
point to the 1.6.0 directory. But that also didn't work. Tried
changing the Current symlink to point to 1.6.0 instead of to A as is
by default.

Well, when I say it didn't work, I mean it didn't help to launch our
WO apps with Java 1.6. They still launched with Java 1.5, even though
typing 'java -version' into the command line returned 1.6, typing in
'sudo -u appserver java -version' returned 1.5.

So the solution was to modify the build.xml file in Eclipse to have it
generate a hard coded path to the JVM to point to 1.6.

Here's what I added to the build.xml file's <woapplication> task:

JVM="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
bin/java"

So it looks like this now:

<woapplication name="${build.app.name}" JVM="/System/Library/
Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java" destDir="$
{dest.dir}" customInfoPListContent="${customInfoPListContent}"
principalClass="${principalClass}" webXML="${webXML}"
webXML_CustomContent="${webXML_CustomContent}"
servletAdaptor="com.webobjects.jspservlet.WOServletAdaptor">

The end result is a MacOSClassPath.txt file with the following entry
at the top:

# JVM == /System/Library/Frameworks/JavaVM.framework/
Versions/1.6.0/Home/bin/java

That works for us, so I thought I'd share it with you.

Thanks go to Mike Schrag for the help with this! Is there anything
that guy doesn't know? :-)

Sincerely,

____________________________________________________________________
Brendan Duddridge | CTO | 403-277-5591 x24 | ***@clickspace.com

ClickSpace Interactive Inc.
Suite L100, 239 - 10th Ave. SE
Calgary, AB T2G 0V9

http://www.clickspace.com

Loading...