PDA

View Full Version : [SOLVED] (sun) java installation



slwx
April 25th, 2010, 09:42 PM
hi,
Recently I've removed all default java and tried to install sun java 6, jdk and jre.

java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)

but I dont seem to be able to run java aplications anymore! The most important beeing netbeans.

I've tried this:
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.15/
but it doesnt work, and honestly, i dont know what it does..

Anyone have an idea? I'm new to ubuntu, so sory if its a dumb question :)

thx

coolcaseley67
April 25th, 2010, 09:55 PM
hi

- go to https://help.ubuntu.com/community/Java and see the Choosing the default Java to use bit , you need to update your alternatives .

- you may need to reinstall the progarms that use java , I know for open office you need to install are package open office-java or on the lines of that


hope it helps

ps for more see http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/

slwx
April 26th, 2010, 03:30 PM
Hello,
It still doesnt work. i've followed the extra info you added at the end. java is installed well, also alternatives are well set. But i dont have a folder named /etc/jvm...
I dont know how to add it, since i dont have authorisation anyware..
thx

Soul-Sing
April 26th, 2010, 03:39 PM
update -15 is outdated and ful of security issue's
try this link: http://sites.google.com/site/easylinuxtipsproject/java

conradin
April 26th, 2010, 03:39 PM
You dont have authorization? You're not root? you may have to contact your administrator.

coolcaseley67
April 26th, 2010, 04:56 PM
hi


-update 15 is out of date but its in ubuntu repos, could do with fixing that some time .

- what you need java?. if its just for everyday internet, openofffice use the openjava , as it says at http://sites.google.com/site/easylinuxtipsproject/java#TOC-OpenJDK-and-the-Icedtea-Plugin-are- the main java is been regularly moved about & removed .:KS 0r just do by the main website ...............

slwx
April 28th, 2010, 05:13 PM
You dont have authorization? You're not root? you may have to contact your administrator.

hi,
the extra info provided by coolcaseley67 (on the website http://www.cyberciti.biz/faq/howto-u...igure-jdk-jre/)
tell me:
"You also need to edit a file called /etc/jvm. This file defines the default system JVM search order. Each JVM should list their JAVA_HOME compatible directory in this file. The default system JVM is the first one available from top to bottom. Open /etc/jvm
$ sudo vi /etc/jvm"

-> but i have no file /etc/jvm
when i go to the folder and try to make one, i get "no authorisation" error..

i dont know how to go in root to make the file, im new!
thx

coolcaseley67
April 28th, 2010, 07:03 PM
hi

- which java are you installing the openjdk or java sun ?
- are you 32bit or 64 bit ?

thanks

slwx
April 29th, 2010, 02:52 PM
hi

- which java are you installing the openjdk or java sun ?
- are you 32bit or 64 bit ?

thanks

hi,
i deleted the default java and installed sun java 6, i've installed sun-6-jdk, jre and plugin. i also updated alternatives.
but java isnt working.. (i cant start netbeans or any internet applications)..
i am using 32 bit system of ubuntu
thx

coolcaseley67
April 29th, 2010, 06:10 PM
hi

i will test it out hm .. how did you download by the website or in ubuntu package mangers ...... ??

back the results

slwx
April 29th, 2010, 06:29 PM
Hello,
to be complete, this is the original problem i had:
http://forums.netbeans.org/post-72261.html (http://forums.netbeans.org/post-72261.html)
its not really relevant, but maybe you want to know.
I was told to install the sun java instead of the default.
this is what i did, step by step:

removing via s/w centre:
OpenJDK java 6 runtime
OpenJDK java 6 webstart

removing via apt:
openjdk-6-jdk
default-jdk
openjdk-6-jre-headless

Then I installed Sun Java:
via apt:
sun-java6-jdk
sun-java6-jre

via s/w centre:
sun-java6-plugin

and finaly
sudo update-alternatives --config java


at this point java sun still didnt work. so i followed the instructions given by you here (http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/)

*at first i didnt have a file at "/etc/jvm" , (this is what i posted on above, i didnt know how to make a file :s)
but now i found my way, i made a file at /etc/jvm/ with this in it:
/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr

like the instructions tell me

finally i made a file
$HOME/.bash_profile

and in it, ther is:

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin



ok, now i have followed evry instruction, still netbeans doenst start, neither do any java applications (e.g. on internet).

thx

coolcaseley67
April 29th, 2010, 10:01 PM
Hi
-I've just tried it MANUALLY and it worked and I verified online @ http://java.com/en/download/installed.jsp .

- i will check netbeans , i think you may need to go in to synaptic package manager and remove the programs and the con figs. then reinstall ..

hope it helps ](*,)

update
netbeans use the openjava ...... so you've remove it witch it needs to run ...

slwx
April 30th, 2010, 05:08 PM
hi,
I have reinstalled java-sun-6 + downloaded netbeans manually from the website, and reinstalled it to. now it is working!
thanks for the help!
slwx

coolcaseley67
April 30th, 2010, 08:15 PM
hi

no pro's

mark this as solved in thread tools

happy ubuntu ing :KS