LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-09-2011, 04:09 AM   #1
iansu
LQ Newbie
 
Registered: Jul 2011
Posts: 8

Rep: Reputation: Disabled
how to set the java version to the version that I want?


jdk-6u26-linux-i586-rpm.bin
It is the version that I 've installed.
---------------------------------------------------------------------
It still shows this :
java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
----------------------------------------------------------------------
How can I set my jdk version to the version that I want?
Thanks!
 
Old 07-09-2011, 04:34 AM   #2
iansu
LQ Newbie
 
Registered: Jul 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
how do I set the java version to the version that I've just installed(Jdk)

I've just installed this jdk version : jdk-1.6.0_26-fcs
=================================================================
When I see the java version,it still shows the below version 1.4
java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
===================================================================
How can I change the java version to the version that I've just intalled(jdk1.6).Thank you very much.I am just a beginner linux.
===================================================================
Then I decided to reinstall and the result and status are like that :

[root@localhost 32]# chmod a+x jdk-6u26-linux-i586-rpm.bin
[root@localhost 32]# ls -l
total 78868
-rwxr-xr-x 1 root root 80669688 Jul 9 21:41 jdk-6u26-linux-i586-rpm.bin
[root@localhost 32]# ./jdk-6u26-linux-i586-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
inflating: jdk-6u26-linux-i586.rpm
inflating: sun-javadb-common-10.6.2-1.1.i386.rpm
inflating: sun-javadb-core-10.6.2-1.1.i386.rpm
inflating: sun-javadb-client-10.6.2-1.1.i386.rpm
inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm
inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm
inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...

Java(TM) SE Development Kit 6 successfully installed.

Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Oracle products, services and training
* Access to early releases and documentation

Product and system data will be collected. If your configuration
supports a browser, the JDK Product Registration form will
be presented. If you do not register, none of this information
will be saved. You may also register your JDK later by
opening the register.html file (located in the JDK installation
directory) in a browser.

For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/registrat...onPrivacy.html

Press Enter to continue.....






[root@localhost 32]# java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
====================================================================
My java version shows still 1.4 how do i change to 1.6(That i just installed)?

Last edited by iansu; 07-09-2011 at 05:24 AM.
 
Old 07-09-2011, 06:26 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
1) su

2)
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_26/bin/java 2

3) /usr/sbin/alternatives --config java
.... And then select the new "sun java".

.
 
Old 07-09-2011, 06:28 AM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
jdk-1.6.0_26-fcs
A clue? Are you using Fedora? If so, try galternatives. Yum-install it if need be. track the JDK. In the entry, the newly installed version should be available, check mark it, give it a high ranking and, if needed, delete the entry of the old version.

That should do...

Luck

Thor
 
Old 07-09-2011, 11:24 AM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

Use galternatives, after install of the other JVM, navigate to the item in question, add your alternative and rate it as high as possible.

You may possibly want do delete the other one, it will not delete the JVM, just the choice the system has...

Luck

Thor
 
Old 07-09-2011, 03:58 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Merged the two VERY closely related threads.
 
Old 07-09-2011, 04:03 PM   #7
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
@ Tinkster
Wow! I have just (almost) been wetting myself thinking I messed answers up! Thanks!
 
  


Reply



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
[SOLVED] Java version not the one I have installed davholla Linux - General 3 03-22-2011 11:53 AM
A question about OS, JDK/Java version and Jboss thomas2004ch Linux - Software 3 08-11-2010 04:03 PM
xmacs java compiling error - jdk version problem lindope Programming 0 09-25-2008 09:58 PM
How to set the default Java version robbbert Linux - Software 4 03-20-2006 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration