You are not logged in.
Pages: 1
Does anyone know of a simple way to switch between multiple JDKs?
Offline
use full path to java or javac
may I ask what you need this for, as java5 aka java 1.5 aka tiger can compile backward compatible code with the target flag.
if you want to "let the whole system know" I guess you could just export the new JAVA_HOME and CLASSPATH variables you want to use before starting the vm
Offline
My work is still officially using 1.3.1 (yuck) but getting ready to use 1.4.2. They are not willing as of yet to go with 1.5 but we (the developers) will convince them.
Offline
you can set what version you want when compiling using 1.5
javac -source 1.3 will fail on all stuff introduced after 1.3 such as generics(1.5) and assert(1.4)
even though you are compiling it with a 1.5 compiler
so it really doesnt matter what version you are using since you can compile everything backward compatible.
install 1.5, and let it pretend it is a 1.3 and spend you lunches lobbying for 1.5
Offline
Setting the source version isn't always a safe bet. There are several API changes in rt.jar that will compile fine as 1.3 or 1.4 using the 1.5 compiler. However, when you take that bytecode and run it on a 1.3 or 1.4 JRE you will get ClassNotFound or NoSuchMethod exceptions all over the place.
Bottom line is, the compiling for older versions works great in 1.5. Just make sure your test environment is set up with the proper support jars in the classpath to C.Y.A.
Offline
Well directly calling the java command fails. I get this
/opt/jdk1.3.1_15/bin/i386/native_threads/java: error while loading shared libraries: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory
I don't seem to have this library. Not sure what to do
Offline
Can you give us some more information? ...Like how did you build your code (switches and compiler version) and what JRE are you trying to run it on. Also, if you can give a simple code example, that would help.
Offline
The only real reason I NEED 1.3.1 is the stupid way my predecessor created the encryption for passwords. We've worked around it but have yet to switch to 1.4.2. Once we switch then this will be useless but I solved my problem. The library I am missing is actually
libstdc++-2-libc6.1-1-2.9.0.so
So I just copied it over from another Linux machine (different distro) and it worked.
Offline
Pages: 1