LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2011, 08:16 AM   #1
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
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
 
Old 05-12-2011, 09:20 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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
 
1 members found this post helpful.
Old 05-12-2011, 09:40 AM   #3
mericet
Member
 
Registered: Jul 2009
Posts: 50

Rep: Reputation: 8
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.
 
1 members found this post helpful.
Old 05-12-2011, 09:44 AM   #4
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
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
 
Old 05-12-2011, 10:15 AM   #5
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
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... 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.

Last edited by brownie_cookie; 05-12-2011 at 10:18 AM.
 
Old 05-12-2011, 11:18 AM   #6
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
downloaded 1.4.19 and it works so never mind
 
Old 05-12-2011, 11:48 AM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
Quote:
Originally Posted by mericet View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding internal IP address without proxy, both Java and Java script enabled studpenguin Linux - Security 12 01-08-2011 09:39 PM
Hiding internal IP address without proxy, both Java and Java script enabled studpenguin Linux - Networking 1 01-02-2011 03:50 AM
[SOLVED] Java Woes: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available ... chytraeus Slackware 10 11-27-2010 11:04 AM
LXer: Java news met with cautious optimism in free Java community LXer Syndicated Linux News 0 11-14-2006 11:21 PM


All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration