These are the steps I used to install the Java JDK binary,Externally on my System which ain't have Internet.
1.Dowload the latest Java JDK for Linux Platform (in my case,jdk-6u22-linux-i586.bin) from the Sun Java site.Using any System Which Have Internet.
(you can also use jdk-6u3-linux-i586.bin and many other versions)
[*Note:Do not download ".rpm" version of jdk(like jdk-6u22-linux-i586-rpm.bin)]
2.In Terminal Change directory to /usr/local/lib [using comand $cd /usr/local/lib]
3.From there extract the JRE or JDK archive file you downloaded:
$ sudo sh /some/path/jdk-6u3-linux-i586.bin
[In the above commands, replace /some/path with where the JRE/JDK .bin resides and of course replace the filename with what it actually is in your case.]
(In my case: $sudo sh /home/Kishor/Downloads/jdk-6u22-linux-i586.bin)
4.Now Lets create some symlinks so that the executables can be run easily:
Change directory to /usr/local/bin [$ cd /usr/local/bin]
From there execute the following set of commands:
$ sudo ln -sf ../lib/jdk1.6.0_22/bin/* .
[Please Pay attention to the "dot(.)" at the end of the command, it is required and IMPORTENT.
And adjust the directory as well to what you have (e.g. jdk1.6.0_03 in folder /usr/local/lib)
(in mycase it is: jdk1.6.0_22/bin)]
5.Verify installation
To verify that the installation was successful, execute
$ java -version
The output should look something like this if everything is well
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
6. Now you can Execute Java Programs From any directory from your system,here is a small example of mine:
kishor@ubuntu:~/Desktop$ javac HelloWorld.java
kishor@ubuntu:~/Desktop$ java HelloWorld
Hello World!!
kishor@ubuntu:~/Desktop$
-Kishor[kishorbenede15@gmail.com]
1.Dowload the latest Java JDK for Linux Platform (in my case,jdk-6u22-linux-i586.bin) from the Sun Java site.Using any System Which Have Internet.
(you can also use jdk-6u3-linux-i586.bin and many other versions)
[*Note:Do not download ".rpm" version of jdk(like jdk-6u22-linux-i586-rpm.bin)]
2.In Terminal Change directory to /usr/local/lib [using comand $cd /usr/local/lib]
3.From there extract the JRE or JDK archive file you downloaded:
$ sudo sh /some/path/jdk-6u3-linux-i586.bin
[In the above commands, replace /some/path with where the JRE/JDK .bin resides and of course replace the filename with what it actually is in your case.]
(In my case: $sudo sh /home/Kishor/Downloads/jdk-6u22-linux-i586.bin)
4.Now Lets create some symlinks so that the executables can be run easily:
Change directory to /usr/local/bin [$ cd /usr/local/bin]
From there execute the following set of commands:
$ sudo ln -sf ../lib/jdk1.6.0_22/bin/* .
[Please Pay attention to the "dot(.)" at the end of the command, it is required and IMPORTENT.
And adjust the directory as well to what you have (e.g. jdk1.6.0_03 in folder /usr/local/lib)
(in mycase it is: jdk1.6.0_22/bin)]
5.Verify installation
To verify that the installation was successful, execute
$ java -version
The output should look something like this if everything is well
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
6. Now you can Execute Java Programs From any directory from your system,here is a small example of mine:
kishor@ubuntu:~/Desktop$ javac HelloWorld.java
kishor@ubuntu:~/Desktop$ java HelloWorld
Hello World!!
kishor@ubuntu:~/Desktop$
-Kishor[kishorbenede15@gmail.com]

cool Buddy...i am going to try this..lso i can see no new posts...we expect more stuff from you buddy
ReplyDeleteI tried the tutorial. There is the jdk folder inside of the /usr/local/lib and all the other files as well. But when i tried to verify the version, it says that try out an apt-get install.
ReplyDeletewhy is that? Could you please help me to figure out this and install jdk correctly?
Thanx!
all steps sucessfull./..i download java from http://java.com/en/download/manual.jsp
ReplyDeletebut i want java applets to be run of firefox mozilla on ubuntu...its s not happening yet..wht to do ..how to install java plugin for firefox
Sorry guys i've been busy....
ReplyDeleteWait for my next post...in that i'll tell
how to install almost all plug ins for ubuntu without internet connection and also VLC player..
hi kishore
ReplyDeleteMy system say's "No such file or directory" for the 2nd step...
I've downloaded the latest jre from java site in my Downloads folder
location of the bin file is as follows
home/team/Downloads/jre-6u22-linux-i586.bin
Plz tell me where to save the bin file and
Hi KANHAI i guess u downloaded the "jre" file it is just JAVA RUNTIME ENVIRONMENT....
ReplyDelete"Jre" can not execute the java programs it can only run compiled class files...so u need to download the JDK(Java Development Kit) it has Jre too...
if u downloaded the ".bin" file to Downloads folder then 3rd step will be
$ sudo sh /uradminname/home/Downloades/jdk-6u3-linux-i586.bin for u...
if u are using UBUNTU then there ain't no go wrong in 2nd step....
regards...,
KISHOR
hey this is a very simple guide for a fresher like me in the linux environment. Thank u very much...the results do not show as I feel that the previous version of jdk needs to uninstall first...can u please help how to d that??
ReplyDeletei encounter the exact same issue as earninginternetmoneyeasy.
ReplyDeleteSet PATH to point to the jre or jdk that is to be used will resolve the issue I and earninginternetmoneyeasy mentioned.
ReplyDeleteSorry guys i was u able to reply to your comments..
ReplyDelete@Neha : First of all Thanks for your Fallow up on My blog...You try removing previous JDK from your Package Manager... That's a quit easy method i guess.. you open the Package manager then select the package to remove it... It might be named as "Open source jdk"...
good luck... let me know after u tried that one please..
kanhai i got a same problem you should set environment variable PATH first write following in console
ReplyDeleteexport PATH="/usr/local/lib/jdk1.6.0_21/bin"
for my case
if you find it helpfull pls reply something to
suraj.comp.eng@gmail.com
ill be very happy if any reply comes
Thanks Suraj! It worked!
DeleteAbout the PATH variable. I had the same problem and resolved it in this way:
ReplyDeletePATH solution
Step 1 : "Dowload the latest Java JDK for Linux Platform (in my case,jdk-6u22-linux-i586.bin) from the Sun Java site.Using any System Which Have Internet."
ReplyDeleteyou are a true IDIOT !!!
@ Sunny : Why......is there any thing wrong in that???
ReplyDeletei am not able install jdk1.6 in my linux mint. so tell me the steps
ReplyDeletethanks, Kishore..it worked perfectly. I was a newbie with linux and was finding it bit intimidating eventhough Ubuntu was more or less windows experience. It was really helpful
ReplyDeleteThanks a lot Kishor!
ReplyDeleteJust a suggestion: You should add a line about 'PATH', as Suraj has mentioned in his comment for completeness of your awesome post!
Thanks again!
Hey Kishor, just a modification to the command that Suraj gave. I am a newbie at software btw and when I tried his command my entire Ubuntu stopped working (I am using Ubuntu 10.40 in a VM). The command that worked for me was:
ReplyDeleteexport PATH=$PATH:/usr/local/lib/jdk1.6.0_whateverVersion/bin/:/usr/local/bin
Basically you have to add the previous paths as well as the new one.
Anyway other than that AWESOME TUTORIAL!!!!
THANK YOU!!