java installation
TRANSCRIPT
dev snipermy programming adventures
Search...
HomeLagosFXAbout meContact
Apr 30 2012
Ubuntu 12.04 – install sun jdk 6-7by Cem Ikta • GNU/Linux, Java • Tags: ubuntu 32
Ubuntu GNU/Linux 12.04 LTS (Precise Pangolin) released. I wanted to manuallyinstall 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 file executeable:
chmod +x jdk-6u32-linux-x64.bin
Extract the bin file:
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
1 of 20 06/12/2012 04:59 PM
./jdk-6u32-linux-x64.bin
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 1sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1
Choose default java:
sudo update-alternatives --config javacsudo update-alternatives --config javasudo 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 64-Bit jdksudo ln -s /usr/lib/jvm/jdk1.6.0_32/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins#for 32-Bit jdksudo 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 file from hereExtract the tar file:
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 1sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_04/bin/java 1sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_04/bin/javaws 1
Choose default java:
sudo update-alternatives --config javacsudo update-alternatives --config java
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
2 of 20 06/12/2012 04:59 PM
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 64-Bit jdksudo ln -s /usr/lib/jvm/jdk1.7.0_04/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins#for 32-Bit jdksudo 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 configuration (Thanks Jack).
Update: I have added Java Plugin configuration for Mozilla Firefox even for Chrome(Thanks shetty).
Getting Real with your (web) application
32 Comments
Klau3Apr 30, 2012 @ 21:11:12
Works if you add those two steps:rm -rf ~/.swt/lib/linux/x86ln -s /usr/lib/jni ~/.swt/lib/linux/x86
Reply
Cem IktaMay 01, 2012 @ 01:46:19
Hi,I have not .swt directory in my ubuntu 12.04 and without those commands itworks!
Reply
Klau3May 01, 2012 @ 11:12:15
1.
12
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
3 of 20 06/12/2012 04:59 PM
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 IktaMay 02, 2012 @ 12:35:33
I have 64-Bit installation and Eclipse Indigo SR2 running withoutproblems. But thanks for your feedback.
Reply
Technology And Software » Ubuntu 12.04 – install sun jdk 6-7May 02, 2012 @ 17:35:06
[...] http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/ [...]
Reply
2.
DorMay 06, 2012 @ 11:49:08
Thanks, it helped.
Reply
3.
SathishkumarMay 07, 2012 @ 09:54:38
Thanks for the guide..
Reply
4.
jackMay 08, 2012 @ 02:07:25
Don’t 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 –config javaws
# Verify the symlinks all point to the new java location$ ls -la /etc/alternatives/ja*
Reply
5.
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
4 of 20 06/12/2012 04:59 PM
Cem IktaMay 09, 2012 @ 12:17:03
Hi Jack,
Thanks for your feedback, I forgot to configure java web start.
Reply
SamirMay 08, 2012 @ 19:45:10
ThanQ very much, it helped me in installing it in Ubuntu 12.04 with out anyproblems
Reply
6.
Vyacheslav RomanenkoMay 09, 2012 @ 01:02:17
Thanks. After ppa:flexiondotorg/java crashed it was really helpfull.
Reply
7.
OndrejMay 10, 2012 @ 00:59:39
Thanks! Helped me a lot.
Reply
8.
Ante PrimoracMay 11, 2012 @ 09:13:12
Change: sudo update-alternatives –install /usr/bin/java javaws /usr/lib/jvm/jdk1.7.0_04/bin/javaws 1to: sudo update-alternatives –install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_04/bin/javaws 1
Reply
Cem IktaMay 11, 2012 @ 11:52:03
Thanks for your attention.
9.
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
5 of 20 06/12/2012 04:59 PM
Reply
srinivasMay 16, 2012 @ 08:22:04
Thanks
Reply
10.
Marcos MaiaMay 17, 2012 @ 14:29:25
Thanks man, it worked perfectly for me. Can I translate this to portuguese andpost in my blog? I will keep the reference to this original post of course.
regards.
Reply
Cem IktaMay 17, 2012 @ 14:34:52
yes of cource.
Reply
Marcos MaiaMay 18, 2012 @ 19:18:38
Thank you, I will probably do the translation and post to my blog thisweekend. I would also suggest you to add jar configuration to your postas it is needed to manually create archives and also to execute somejava programs.
regards.
Reply
11.
Ishan ThilinaMay 18, 2012 @ 12:23:18
Thanks, This works…!
Reply
12.
mort chase13.
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
6 of 20 06/12/2012 04:59 PM
May 22, 2012 @ 23:03:37
New to linux and ubuntu.installled jdk7 on ubuntu12.04 as outlined on thiswebpage.Version checked ok. Tried to use javac and java as:javac progname.java =>error cannot read binary files. same with java.progname.I have some successful experience with java on windows 7 ,classpath and all,noneso far on ubuntu/linux2. Would greatly appreciate any help, thanks.mort chase
Reply
Cem IktaMay 22, 2012 @ 23:46:29
Please check whether you have installed correct 32-bit/64-bit jdk for yoursystem, I have 64-bit installed.Maybe your java file path is wrong? Please check your libs / package /classpath!if everything ok but still error occurs, please try with eclipse or netbeanside, then you can see with eclipse or netbeans better error messages.
Reply
mort chaseMay 23, 2012 @ 00:53:40
Thanks so much Cem Ikta, will try what you suggestredregards: mort chase
Reply
mort chaseJun 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 tonew location ok. Version1.6.0_24 is ithe one nstalled. Any suggestions regarding $path setupaftersuccessful installation would help this novice.regards: mort chase
Reply
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
7 of 20 06/12/2012 04:59 PM
shettyMay 24, 2012 @ 06:14:47
Enable mozilla firefox plugin, to reflect 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
14.
mohamedMay 28, 2012 @ 21:24:35
j’ai bien suivi les intrictions .j’ai abouti bien sur a installer jdk7 sous ubuntu12.04merci de m avoir aider
Reply
15.
mohamedMay 28, 2012 @ 21:35:16
sauf que j’ai 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 repertoirejvm/jdk1.7.0_04/bin/javac 1=jvm/bin ………………..jdk1.7.0_04 n’existe pac-a-d :la commandesudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_04/bin/javac 1on la remplace parsudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/bin/javac 1c valable pour les autres commandes
Reply
Cem IktaMay 28, 2012 @ 21:44:19
I have 2 JDK directories: jvm/jdk1.6.0_32 and jvm/jdk1.7.0_04.
Reply
16.
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
8 of 20 06/12/2012 04:59 PM
StephenJun 03, 2012 @ 19:59:17
I installed 64 bit version 7 as per all these instructions, I can get Java working inFirefox, but not in Ubuntu 12.04. Java doesn’t show up in the list of programs soI can’t set jar files to open with Java to play Minecraft. When I “search forapplications online” it tells me that it needs OpenJDK Runtime 6 or 7 installed. Ithought Sun’s Java was meant to this job? Any ideas what I’ve done wrong?
Reply
Cem IktaJun 03, 2012 @ 21:43:54
open terminalgo to the .jar file foldertype: java -jar filename.jar in the terminal
Reply
17.
EritJun 03, 2012 @ 22:24:15
Muchas gracias. Ya me avia desesperado, Thanks (y)
Reply
18.
MaxouMaskJun 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
19.
GPattonJun 07, 2012 @ 16:44:01
Works like a charm , Thanks
Reply
20.
Leave a Reply
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
9 of 20 06/12/2012 04:59 PM
Name (required)
Mail (required)
Website
Submit Comment
Notify me of followup comments via e-mail
Recent Posts
Ubuntu 12.04 – install sun jdk 6-7Apr 30, 2012
Getting Real with your (web) applicationFeb 21, 2012
Desktop Applications with Java SwingFeb 06, 2012
Pyramid web framework application: CustomersJan 12, 2012
Pyramid framework tips : WebHelpers html tags and PaginateJan 12, 2012
Categories
Database (1)Featured (12)GNU/Linux (1)GWT (2)Java (4)
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
10 of 20 06/12/2012 04:59 PM
Python (12)
Tags
Aptana Studio Beaker Bootstrap from Twitter Desktop Applications Eclipse FormEncode Java
Swing Mako Templates MySQL project management Pylons Project PyramidFramework Pyramid SimpleForm SQLAlchemy ubuntu Web Applications web
development WebHelpers
Archives
April 2012February 2012January 2012August 2011June 2011May 2011August 2010
Latest Tweets
RT @arungupta: 6.46 million LinkedIn passwords leaked: http://t.co/Nbwb0o4M Ichanged my password! #RT @byilmaz: Mobil kullanıcıların %91'i telefonlarını 7/24 sürekli yakınlarındabulunduruyorlar. Commerce için inanılmaz bir fırsat. R.M ... #Muyap ShiftDeleteNet Forum'u kapattiriyor. Kolelik anlasmasi gibi taahhutnameistiyor. #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, sortingfunctions etc. http://t.co/rDELpwHT #pyramid (web framework) #pylons #Pyramid framework tips:Flash messages http://t.co/fALfHu3R #pyramid (webframework) #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 #makotemplates #pyramid (web framework) #pylons #Generic entity locator for #RequestFactory in #Gwt: http://t.co/wpFtIxB ##KendoUI: #html5 + #css3 + #javascript very good lightweight web applicationcomponents. http://t.co/pQc6Ry4 #
Follow me on Twitter
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
11 of 20 06/12/2012 04:59 PM
© Copyright dev sniper 2012Powered by WordPress. Theme by Themify.me
Expandnext previousClose
Previous
0/0
Next
Ubuntu 12.04 – install sun jdk 6-7 http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
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