LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Downgrading Java 1.6 to Java 1.4 (https://www.linuxquestions.org/questions/linux-newbie-8/downgrading-java-1-6-to-java-1-4-a-880296/)

brownie_cookie 05-12-2011 07:16 AM

Downgrading Java 1.6 to Java 1.4
 
Hi all

I need to downgrade my java version from 1.6 to 1.4 for some reasons (trust me , it's necessary) so , can someone provide me some info how i can do this most efficient?

It's not needed to REMOVE java 1.6, i just need to download and install 1.4 and use it.
Can someone help me?

thanks in advance

MensaWater 05-12-2011 08:20 AM

Check /usr/lib/java* to see what is there. It is possible you already have 1.4 along with 1.6 (and maybe even 1.5) but your default is the 1.6. If so you just need to insure the path to java you're using for the specific app that has the 1.4 requirement is using the 1.4 version. (I wouldn't change the default.) We've had to do this often for various Oracle BS apps. (Of course Java was a Sun product so Oracle now owns Java too.)

If you are on CentOS/RHEL you can do "yum list java*" which will show you what Java is available and what you have installed. If it is in the repository you can use "yum install <version>" to install the Java from the repository. (Where version is one of the packages identified in the list.)

If you can't find the one you want there you should be able to download it from Oracle. I used to go to sun.java.com but that redirected me to new link this morning:
http://www.oracle.com/technetwork/java/index.html

Navigating from there I got to this page:

On that somewhat confusing page it appears you'd want to select the download next to "J2SDK/J2RE - 1.4"
http://www.oracle.com/technetwork/ja...ve-139210.html

mericet 05-12-2011 08:40 AM

Is it really necessary?
Will it not be sufficient to make the java compiler think it's 1.4?

Code:

javac -source 1.4 myclass.java
will compile Java code as if you were using the specified version. If you are using an IDE you set compiler options, e.g. in Eclipse use Window > Preferences > Java > Compiler and set the Compiler compliance level to 1.4.

brownie_cookie 05-12-2011 08:44 AM

The folder u said, there are folders for version 1.4.0, 1.4.1, 1.4.2, .... but there is nothing in it (strange) but i've installed the version 1.4 already and it's indeed not the purpose to use 1.4 all the time, i just needed it for this script only

so i do
/path/to/folder/bin/java .......

thanks ;)

brownie_cookie 05-12-2011 09:15 AM

hmm, on my other server it ain't working...
MensaWater, when i download java 1.4.<version> and when i try to install the .bin package, he says that file is corrupted... :confused: how's that??

Quote:

Do you agree to the above license terms? [yes or no]
yes
Unpacking...
tail: cannot open `+371' for reading: No such file or directory
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.

brownie_cookie 05-12-2011 10:18 AM

downloaded 1.4.19 and it works ;) so never mind

MensaWater 05-12-2011 10:48 AM

Quote:

Originally Posted by mericet (Post 4354307)
Is it really necessary?
Will it not be sufficient to make the java compiler think it's 1.4?

Code:

javac -source 1.4 myclass.java
will compile Java code as if you were using the specified version. If you are using an IDE you set compiler options, e.g. in Eclipse use Window > Preferences > Java > Compiler and set the Compiler compliance level to 1.4.

Although I pointed to the JDK I don't know that the OP was trying to "compile" anything. He likely was trying to run an app that was complaining about the later 1.6 java runtime.


All times are GMT -5. The time now is 04:30 PM.