How to install Jdk in Ubuntu 9.04

146 views
Skip to first unread message

Abhik Sen Gupta(WBUT,SIT)

unread,
Jun 14, 2009, 10:23:11 PM6/14/09
to wbut-lug
How to install sun java in ubuntu 9.04
I download the jdk from the java.sun.com the file type for the jdk for
linux is .bin
I installed this jdk in my system using following instruction
#sudo chmod 777 jdk-6u13-linux-i586.bin
#sudo ./jdk-6u13-linux-i586.bin
then the message is shown that the jdk i sucessfully installed in your
machine.


But when I try execute the javac command I get the message this
The program 'javac' can be found in the following packages:
* openjdk-6-jdk
* ecj
* gcj-4.3
* java-gcj-compat-dev
* gcj-4.2
* jikes-classpath
* jikes-kaffe
* kaffe
* sun-java5-jdk
* sun-java6-jdk
Try: sudo apt-get install <selected package>
bash: javac: command not found


Then I think That the path is not set
But I set the path in /etc/enviroment
and the content of the file is
PATH="/home/sanisayani/java/jdk1.6.0_13/bin:.:/usr/local/sbin:/usr/
local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

LANG="en_AU.UTF-8"
LANGUAGE="en_AU:en"
JAVA_HOME="/home/sanisayani/java/jdk1.6.0_13"
CLASSPATH="/home/sanisayani/java/jdk1.6.0_13/lib:."

But javac is not working

Please say how I install The jdk standalone in my system beacuse of
slow connection I can not install through online
command that #sudo apt-get install <package-name>....

Indranil Das Gupta

unread,
Jun 15, 2009, 3:37:10 PM6/15/09
to wbut...@googlegroups.com
Abhik,

On Mon, Jun 15, 2009 at 7:53 AM, Abhik Sen
Gupta(WBUT,SIT)<sanis...@gmail.com> wrote:
>
> How to install sun java in ubuntu 9.04

http://www.ubuntugeek.com/how-to-install-java-runtime-environment-jre-in-ubuntu-904-jaunty.html

replacing jre with jdk should be your answer.

> But when I try execute the javac command I get the message this
> The program 'javac' can be found in the following packages:
>  * openjdk-6-jdk
>  * ecj
>  * gcj-4.3
>  * java-gcj-compat-dev
>  * gcj-4.2
>  * jikes-classpath
>  * jikes-kaffe
>  * kaffe
>  * sun-java5-jdk
>  * sun-java6-jdk
> Try: sudo apt-get install <selected package>
> bash: javac: command not found

A little googling around would have given you this link
http://www.linuxforums.org/forum/ubuntu-help/98237-sun-java6-jdk.html

> Then I think That the path is not set
> But I set the path in /etc/enviroment
> and the content of the file is
> PATH="/home/sanisayani/java/jdk1.6.0_13/bin:.:/usr/local/sbin:/usr/
> local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
>
> LANG="en_AU.UTF-8"
> LANGUAGE="en_AU:en"
> JAVA_HOME="/home/sanisayani/java/jdk1.6.0_13"
> CLASSPATH="/home/sanisayani/java/jdk1.6.0_13/lib:."
>
> But javac is not working

Of course it won't! read the *following* from
https://help.ubuntu.com/community/Java

Choosing the default Java to use

Just installing new Java flavours does not change the default Java
pointed to by /usr/bin/java.

You can also use the following command to interactively make the change;

* Open a Terminal window

Run sudo update-alternatives --config java

* Follow the onscreen prompt

hth
-IDG

abhik sengupta

unread,
Jun 16, 2009, 1:48:40 AM6/16/09
to wbut...@googlegroups.com
Thanks a lot for the answer I have configured the java but there is a problem when I want to installed sun related product like sun application server  or netbeans IDE which is allways search the sun JVM installed in the system before installation so its failed to install what the solution ofr this problem...
How ever i set the default javac in the classpath and export in the terminal but Netbeans IDE give the same problem that The jre 5 or later version of sun must be installed ij the system....
--
With Pleasure
Abhik Sen Gupta
Research Engineer.
Indian Institute of Management Calcutta,Joka  
Mob-+919433748302  
Reply all
Reply to author
Forward
0 new messages