Vous êtes sur la page 1sur 20

Ubuntu 12.

04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

dev sniper my programming adventures

Search...
Home LagosFX About me Contact Apr 30 2012

Ubuntu 12.04 install sun jdk 6-7


by Cem Ikta GNU/Linux, Java Tags: ubuntu 32

Ubuntu GNU/Linux 12.04 LTS (Precise Pangolin) released. I wanted to manually install the Sun JDK 6 and 7 on Ubuntu. Installing Sun JDK 6 on Ubuntu 12.04: Download the sun jdk 6 bin from here. Make the bin le executeable:
chmod +x jdk-6u32-linux-x64.bin

Extract the bin le:

1 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7


./jdk-6u32-linux-x64.bin

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

Move extracted folder to this location:


sudo mv jdk1.6.0_32 /usr/lib/jvm/

Install new java source in system:


sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1 sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1

Choose default java:


sudo update-alternatives --config javac sudo update-alternatives --config java sudo update-alternatives --config javaws

java version test:


java -version

Verify the symlinks all point to the new java location:


ls -la /etc/alternatives/java*

Enable Java plugin for Mozilla Firefox (even for Chrome)


#for sudo #for sudo 64-Bit jdk ln -s /usr/lib/jvm/jdk1.6.0_32/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins 32-Bit jdk ln -s /usr/lib/jvm/jdk1.6.0_32/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins

Installing Sun JDK 7 on Ubuntu 12.04: Download the sun jdk 7 tar le from here Extract the tar le:
tar -xvzf jdk-7u4-linux-x64.tar.gz

Move extracted folder to this location:


sudo mv jdk1.7.0_04 /usr/lib/jvm/

Install new java source in system:


sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_04/bin/javac 1 sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_04/bin/java 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_04/bin/javaws 1

Choose default java:


sudo update-alternatives --config javac sudo update-alternatives --config java

2 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7


sudo update-alternatives --config javaws

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

java version test:


java -version

Verify the symlinks all point to the new java location:


ls -la /etc/alternatives/java*

Enable Java plugin for Mozilla Firefox (even for Chrome)


#for sudo #for sudo 64-Bit jdk ln -s /usr/lib/jvm/jdk1.7.0_04/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins 32-Bit jdk ln -s /usr/lib/jvm/jdk1.7.0_04/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins

Update: I have added Java Web Start conguration (Thanks Jack). Update: I have added Java Plugin conguration for Mozilla Firefox even for Chrome (Thanks shetty). Getting Real with your (web) application 32 Comments
12

1.

Klau3
Apr 30, 2012 @ 21:11:12

Works if you add those two steps: rm -rf ~/.swt/lib/linux/x86 ln -s /usr/lib/jni ~/.swt/lib/linux/x86 Reply

Cem Ikta
May 01, 2012 @ 01:46:19

Hi, I have not .swt directory in my ubuntu 12.04 and without those commands it works! Reply

Klau3
May 01, 2012 @ 11:12:15

3 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

I did a fresh precise 32-Bit install. Without these two lines eclipse miss the swt-gtk library see: https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/728825 Reply

Cem Ikta
May 02, 2012 @ 12:35:33

I have 64-Bit installation and Eclipse Indigo SR2 running without problems. But thanks for your feedback. Reply 2. Technology And Software Ubuntu 12.04 install sun jdk 6-7
May 02, 2012 @ 17:35:06

[...] http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/ [...] Reply 3.

Dor
May 06, 2012 @ 11:49:08

Thanks, it helped. Reply 4.

Sathishkumar
May 07, 2012 @ 09:54:38

Thanks for the guide.. Reply 5.

jack
May 08, 2012 @ 02:07:25

Dont forget javaws in your update-alternatives command: $ sudo update-alternatives install /usr/bin/javaws javaws /usr/lib /jvm/jdk1.6.0_32/bin/javaws 1 $ sudo update-alternatives cong javaws # Verify the symlinks all point to the new java location $ ls -la /etc/alternatives/ja* Reply
4 of 20 06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

Cem Ikta
May 09, 2012 @ 12:17:03

Hi Jack, Thanks for your feedback, I forgot to congure java web start. Reply 6.

Samir
May 08, 2012 @ 19:45:10

ThanQ very much, it helped me in installing it in Ubuntu 12.04 with out any problems Reply 7.

Vyacheslav Romanenko
May 09, 2012 @ 01:02:17

Thanks. After ppa:exiondotorg/java crashed it was really helpfull. Reply 8.

Ondrej
May 10, 2012 @ 00:59:39

Thanks! Helped me a lot. Reply 9.

Ante Primorac
May 11, 2012 @ 09:13:12

Change: sudo update-alternatives install /usr/bin/java javaws /usr/lib /jvm/jdk1.7.0_04/bin/javaws 1 to: sudo update-alternatives install /usr/bin/javaws javaws /usr/lib /jvm/jdk1.7.0_04/bin/javaws 1 Reply

Cem Ikta
May 11, 2012 @ 11:52:03

Thanks for your attention.

5 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

Reply 10.

srinivas
May 16, 2012 @ 08:22:04

Thanks Reply 11.

Marcos Maia
May 17, 2012 @ 14:29:25

Thanks man, it worked perfectly for me. Can I translate this to portuguese and post in my blog? I will keep the reference to this original post of course. regards. Reply

Cem Ikta
May 17, 2012 @ 14:34:52

yes of cource. Reply

Marcos Maia
May 18, 2012 @ 19:18:38

Thank you, I will probably do the translation and post to my blog this weekend. I would also suggest you to add jar conguration to your post as it is needed to manually create archives and also to execute some java programs. regards. Reply 12.

Ishan Thilina
May 18, 2012 @ 12:23:18

Thanks, This works! Reply 13.


6 of 20

mort chase
06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7


May 22, 2012 @ 23:03:37

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

New to linux and ubuntu.installled jdk7 on ubuntu12.04 as outlined on this webpage. Version checked ok. Tried to use javac and java as: javac progname.java =>error cannot read binary les. same with java.progname. I have some successful experience with java on windows 7 ,classpath and all, none so far on ubuntu/linux2. Would greatly appreciate any help, thanks. mort chase Reply

Cem Ikta
May 22, 2012 @ 23:46:29

Please check whether you have installed correct 32-bit/64-bit jdk for your system, I have 64-bit installed. Maybe your java le path is wrong? Please check your libs / package / classpath! if everything ok but still error occurs, please try with eclipse or netbeans ide, then you can see with eclipse or netbeans better error messages. Reply

mort chase
May 23, 2012 @ 00:53:40

Thanks so much Cem Ikta, will try what you suggestred regards: mort chase Reply

mort chase
Jun 11, 2012 @ 22:43:54

from mort chase to Cem Ikta: Follwed istall- procedures for jdl1.7.0_04 as you outlined above. version ok, mozilla plugins ok,symlinks java, javac and javaws point to new location ok. Version 1.6.0_24 is ithe one nstalled. Any suggestions regarding $path setup after successful installation would help this novice. regards: mort chase Reply

7 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

14.

shetty
May 24, 2012 @ 06:14:47

Enable mozilla refox plugin, to reect even on chrome : 32 bit: ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/ 64 bit: ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/ Reply 15.

mohamed
May 28, 2012 @ 21:24:35

jai bien suivi les intrictions .jai abouti bien sur a installer jdk7 sous ubuntu 12.04 merci de m avoir aider Reply 16.

mohamed
May 28, 2012 @ 21:35:16

sauf que jai not sudo mv jdk1.7.0_04 /usr/lib/jvm/ :donc le jvm va contenir tous les contenus du (jdk1.7.0_04) donc le repertoire jvm/jdk1.7.0_04/bin/javac 1=jvm/bin .. jdk1.7.0_04 nexiste pa c-a-d :la commande sudo update-alternatives install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_04 /bin/javac 1 on la remplace par sudo update-alternatives install /usr/bin/javac javac /usr/lib/jvm/bin/javac 1 c valable pour les autres commandes Reply

Cem Ikta
May 28, 2012 @ 21:44:19

I have 2 JDK directories: jvm/jdk1.6.0_32 and jvm/jdk1.7.0_04. Reply

8 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

17.

Stephen
Jun 03, 2012 @ 19:59:17

I installed 64 bit version 7 as per all these instructions, I can get Java working in Firefox, but not in Ubuntu 12.04. Java doesnt show up in the list of programs so I cant set jar les to open with Java to play Minecraft. When I search for applications online it tells me that it needs OpenJDK Runtime 6 or 7 installed. I thought Suns Java was meant to this job? Any ideas what Ive done wrong? Reply

Cem Ikta
Jun 03, 2012 @ 21:43:54

open terminal go to the .jar le folder type: java -jar lename.jar in the terminal Reply 18.

Erit
Jun 03, 2012 @ 22:24:15

Muchas gracias. Ya me avia desesperado, Thanks (y) Reply 19.

MaxouMask
Jun 04, 2012 @ 15:43:14

hi thanks for the guide, very hepful, But watchout for x86 architecture, the link for the mozilla plugin is : sudo ln -s /usr/lib/jvm/jdk1.7.0_04/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins Just replace the amd64 with i386 Reply 20.

GPatton
Jun 07, 2012 @ 16:44:01

Works like a charm , Thanks Reply Leave a Reply

9 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

Name (required) Mail (required) Website

Submit Comment
Notify me of followup comments via e-mail Recent Posts

Ubuntu 12.04 install sun jdk 6-7


Apr 30, 2012

Getting Real with your (web) application


Feb 21, 2012

Desktop Applications with Java Swing


Feb 06, 2012

Pyramid web framework application: Customers


Jan 12, 2012

Pyramid framework tips : WebHelpers html tags and Paginate


Jan 12, 2012

Categories Database (1) Featured (12) GNU/Linux (1) GWT (2) Java (4)
10 of 20 06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

Python (12) Tags


Aptana Studio
Swing

Beaker Bootstrap from Twitter Desktop Applications Eclipse FormEncode Java

Mako Templates

MySQL project management Pylons Project Pyramid


ubuntu Web Applications web

Framework Pyramid SimpleForm SQLAlchemy


development

WebHelpers

Archives April 2012 February 2012 January 2012 August 2011 June 2011 May 2011 August 2010 Latest Tweets RT @arungupta: 6.46 million LinkedIn passwords leaked: http://t.co/Nbwb0o4M I changed my password! # RT @byilmaz: Mobil kullanclarn %91'i telefonlarn 7/24 srekli yaknlarnda bulunduruyorlar. Commerce iin inanlmaz bir frsat. R.M ... # Muyap ShiftDeleteNet Forum'u kapattiriyor. Kolelik anlasmasi gibi taahhutname istiyor. #muyap #sdn #webrazzi http://t.co/NvpDADoJ # http://t.co/81MsaX1F - bilisim ve yazilim teknolojileri icin soru cevap platformu. # Pyramid web framework demo app: CRUD, list, paginate, search, sorting functions etc. http://t.co/rDELpwHT #pyramid (web framework) #pylons # Pyramid framework tips:Flash messages http://t.co/fALfHu3R #pyramid (web framework) #mako templates #beaker #bootstrap from twitter #jquery # Pyramid framework tips : Beaker session factory settings http://t.co/0edkNy61 #pyramid (web framework) #pylons #beaker # Pyramid framework tips : Mako Templates settings http://t.co/rjRtwpwT #mako templates #pyramid (web framework) #pylons # Generic entity locator for #RequestFactory in #Gwt: http://t.co/wpFtIxB # #KendoUI: #html5 + #css3 + #javascript very good lightweight web application components. http://t.co/pQc6Ry4 # Follow me on Twitter

11 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

Copyright dev sniper 2012 Powered by WordPress. Theme by Themify.me

Expand next previous Close Previous 0/0 Next

12 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

13 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

14 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

15 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

16 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

17 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

18 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

19 of 20

06/12/2012 04:59 PM

Ubuntu 12.04 install sun jdk 6-7

http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

20 of 20

06/12/2012 04:59 PM

Vous aimerez peut-être aussi