hi,
is it possible to have two different version of java on linux centos5
currently it is running 1.6.0 - which i would like to keep it that way sinse i have red5

but
i also need 1.4 for a gaming server ES
gaming server is asking to use at least and at most 1.4

"No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.4 and at most 1.4.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM."

can you please help me how could i do this if possible?

thank you

Recommended Answers

All 17 Replies

It's possible on Windows to have several different versions of java available.
One is the default, the others I get to by using full paths to the javac.exe or java.exe commands.

what about centos5 on linux

You can download the self-extracting .bin file for 1.4.2_19 from http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase14-419411.html#j2sdk-1.4.2_30-sol-JPR

After the download is done, just fire:

chmod +x j2sdk-1_4_2_19-linux-i586.bin
./j2sdk-1_4_2_19-linux-i586.bin

This will fire-off the installer and bring up a licence agreement screen which you will have to agree to. Once installation is done, you'll have a new folder called "j2sdk1.4.2_19" in the folder in which the installation was fired. This method also has the advantage of not clobbering your system wide Java installation. Just make sure that you properly set the $PATH to include this new java instead of using the system default 1.6.

below is the final result i get, it does not seem to be working
what else could i do?

"Unpacking...
Checksumming...
1
The download file appears to be corrupted. Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.
"

I was able to properly download and install it so either it's a corrupt download (try downloading again) or maybe the given binary package is not compatible with your linux installation (unlikely). Can you do a 'ls -ltr' of the bin file and post the results here?

should i just type 'ls-ltr' when i am at /usr/lib/jvm/
would that be ok?
i tried few other version but similar problem


[root@44911 jvm]# ls -ltr j2sdk-1_4_2_18-linux-i586.bin
-rwxr-xr-x 1 root root 36379527 Dec 21 22:32 j2sdk-1_4_2_18-linux-i586.bin

i tried 2 more different ones but same problem

maybe is the issue below?

[root@44911 jvm]# uname -m
x86_64

AFAIK, 32 bit executable should be perfectly fine for a 64 bit OS. Here is the output of my box:

(proj)sanjayts@VirtualBox:~/stuff$ ls -l j2sdk-1_4_2_19-linux-i586.bin 
-rwxr-xr-x 1 sanjayts sanjayts 36387084 2011-12-22 00:04 j2sdk-1_4_2_19-linux-i586.bin

Can you do a fresh download of 2_19 (instead of 2_18) and try again? If it doesn't work, do a `ls -l` and check if the size is same as the one I posted above.

If all the above still doesn't work, we might have bigger problems but let's try this out first...

this is what i got now

-rwxr-xr-x 1 root root 36387084 Dec 22 04:39 j2sdk-1_4_2_19-linux-i586.bin
y
Unpacking...
Checksumming...
0
0
Extracting...
./j2sdk-1_4_2_19-linux-i586.bin: ./install.sfx.1871: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
Done.

OK, bit of progres. It seems that you can only use 32 bit libraries on 64 bit OS if you have the required 32 bit dependent libraries installed. The details for that are pretty much specific to the distro (CentOS in your case) so you would be better off asking on the official CentOS forums. In case you don't mind an "experimental" solution, try out the command mentioned here?

yum install glibc.i586 glibc-devel.i586
yum install libX*

i did not do the steps from the link yet but i did this

[root@44911 jvm]# yum install glibc.i586 glibc-devel.i586
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirrors.loosefoot.com
 * extras: mirrors.loosefoot.com
 * updates: centos.mirror.lstn.net
base                                                     | 3.7 kB     00:00
c5-testing                                               | 3.0 kB     00:00
extras                                                   | 3.5 kB     00:00
updates                                                  | 3.5 kB     00:00
updates/primary_db                                       | 120 kB     00:00
Setting up Install Process
No package glibc.i586 available.
No package glibc-devel.i586 available.
Error: Nothing to do

Hmm...you seem to be using a pretty recent version of CentOS which might explain missing i586 packages. Can you try installing i686 packages for glibc and then run the installer?

would you know where i could get that from?

I meant replace "yum install glibc.i586 glibc-devel.i586" with "yum install glibc.i686 glibc-devel.i686" and try again.

BTW, just FYI, you can run Java in any compatibility mode. So, if you have JDK 6 and want to run it as 1.4, you can do "java -version:1.4 -version" and it'll print 1.4. Similarly, when starting your server, if you have access to the .bat or .sh file which starts the server, you can add a "-version:1.4" to it and it'll start up in 1.4 compatibility mode. What is the command line you are using to start the server?

commented: you are great thank you for not giving up on me +3

Thank you very much not giving up on me
after "yum install glibc.i686 glibc-devel.i686"
i did what you originally told me how to install it and it worked

thank you very very much

commented: Good luck with your project :) +17
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.