|
Question: I'm currently using Mac OS/X 10.4 with Java 1.5.x. But, for a certain application I need to use a previous version of Java, which I have installed. How do I do this?
Answer: The hardest part about this is finding where the previous Java version is installed. There are probably easier ways to do it, but I ended up using the mdfind command, which is the command-line version of Spotlight. After a lot of grep-ing ... I created a shell script that looks like this:
#!/bin/sh
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2
PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/:${PATH}
java -cp MyApplication.jar path.to.MainClass
This puts all the Java 1.4.2 information in my PATH and CLASSPATH before the 1.5.x installation, and everything works fine.
|