LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 05: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, 05: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 06:24 AM.
 
Old 07-09-2011, 07:26 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,279

Rep: Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664
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, 07:28 AM   #4
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,228
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
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, 12:24 PM   #5
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,228
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
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, 04:58 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

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

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


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


All times are GMT -5. The time now is 02:22 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration