LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   help to install jdk (https://www.linuxquestions.org/questions/ubuntu-63/help-to-install-jdk-491174/)

Carunkumar 10-10-2006 01:31 PM

help to install jdk
 
I need to create and execute small java programs.Can anyone help me install the jdk??

I didn't find a version for ubuntu :(

please help!

-C Arunkumar .

IBall 10-10-2006 09:36 PM

I think Java is in the "Multiverse" repository. In the /etc/apt/sources.list, find the line referring to the Universe repo, and add the word "multiverse" at the end.

Run "sudo aptitude update", and then you should be able to install the JDK using: "sudo aptitude install sun-java5-jdk".

If that doesn't work, I have instructions Here. Follow the Debian specific instructions, which should work on Ubuntu. Make sure you download the ".bin" from the Java website, not the rpm.

I hope this helps
--Ian

Carunkumar 10-10-2006 11:00 PM

Tried the first method you told me.

when i used the command i got the following lines.

root@Carunkumar:/home/carunkumar# aptitude install sun-java5-jdk
Reading package lists... Done
Building dependency tree... Done
Initializing package states... Done
Building tag database... Done
Couldn't find any package matching "sun-java5-jdk". However, the following
packages contain "sun-java5-jdk" in their description:
sun-java5-bin sun-java5-jre
The following packages have been kept back:
acpi-support app-install-data app-install-data-commercial base-files
bind9-host binutils-static capplets-data cpio cupsys cupsys-bsd
cupsys-client deskbar-applet desktop-file-utils dnsutils eog evince
file-roller firefox firefox-gnome-support flashplugin-nonfree gdb gdm
gedit gedit-common gimp gimp-data gimp-python gnome-about
gnome-accessibility-themes gnome-app-install gnome-applets
gnome-applets-data gnome-control-center gnome-desktop-data
gnome-doc-utils gnome-games gnome-games-data gnome-media gnome-menus
gnome-panel gnome-panel-data gnome-screensaver gnome-session
gnome-terminal gnome-terminal-data gnome-themes gnupg gstreamer0.10-alsa
gstreamer0.10-gnomevfs gstreamer0.10-plugins-base
gstreamer0.10-plugins-base-apps gstreamer0.10-x gtk2-engines-clearlooks
gtk2-engines-crux gtk2-engines-highcontrast gtk2-engines-industrial
gtk2-engines-lighthouseblue gtk2-engines-mist gtk2-engines-pixbuf
gtk2-engines-redmond95 gtk2-engines-smooth gtk2-engines-thinice
gtkhtml3.8 gzip language-pack-en language-pack-en-base
language-pack-gnome-en language-pack-gnome-en-base language-selector
language-selector-common libbind9-0 libcupsimage2 libcupsys2 libdns21
libeel2-2 libeel2-data libfreetype6 libgd2-noxpm libgimp2.0 libglib2.0-0
libglib2.0-data libgnome-desktop-2 libgnome-menu2 libgnomecups1.0-1
libgnomeprint2.2-0 libgnomeprint2.2-data libgnomeui-0 libgnomeui-common
libgnomevfs2-0 libgnomevfs2-bin libgnomevfs2-common libgnomevfs2-extra
libgnutls12 libgstreamer-plugins-base0.10-0 libgtk2.0-0 libgtk2.0-bin
libgtk2.0-common libgtkhtml3.8-15 libgtksourceview-common
libgtksourceview1.0-0 libisc11 libisccc0 libisccfg1 libkrb53 liblwres9
libmagick9 libmetacity0 libmono0 libmysqlclient15off libnautilus-burn3
libnautilus-extension1 libnspr4 libnss3 libpanel-applet2-0 libpango1.0-0
libpango1.0-common libpq4 libsmbclient libsoup2.2-8 libssl0.9.8
libtag1c2a libtheora0 libtiff4 libtotem-plparser1 libvte-common libvte4
libwmf0.2-7 libwnck-common libwnck18 libxfont1 linux-386 linux-image-386
linux-restricted-modules-386 linux-restricted-modules-common login
metacity mono-classlib-1.0 mono-common mono-jit mysql-common nautilus
nautilus-cd-burner nautilus-data openoffice.org openoffice.org-base
openoffice.org-calc openoffice.org-common openoffice.org-core
openoffice.org-draw openoffice.org-evolution openoffice.org-gnome
openoffice.org-gtk openoffice.org-impress openoffice.org-java-common
openoffice.org-l10n-en-us openoffice.org-math openoffice.org-writer
openssh-client openssl passwd pcmcia-cs pmount ppp python-gmenu
python-pyorbit python-uno python-vte python2.4 python2.4-examples
python2.4-gdbm python2.4-minimal python2.4-pyorbit python2.4-tk readahead
samba-common smbclient sound-juicer ssh-askpass-gnome totem
totem-gstreamer ttf-opensymbol ubuntu-base ubuntu-desktop ubuntu-docs
ubuntu-minimal ubuntu-standard wpasupplicant xserver-xorg-core
xserver-xorg-input-mouse yelp zenity
0 packages upgraded, 0 newly installed, 0 to remove and 191 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
root@Carunkumar:/home/carunkumar#



But am not able to find jdk in my synaptic package manager nor I am able to run it.

what is the difference between apt-getand aptitude?


Thank you for you help!

-C Arunkumar

IBall 10-10-2006 11:33 PM

Try: "apt-cache search sun-java5-jdk" and see what shows up. Have you added the "multiverse" repository and run apt-get update?

As for apt-get v aptitude, try [URL="http://www.psychocats.net/ubuntu/aptitude"]This[URL] page for an excellent description.

--Ian

Carunkumar 10-11-2006 12:59 AM

sorry I hadn't added the multiverse in the right place.I was able to install it using the same command after adding it.Thanks a lot for the help and the link!





-Arunkumar C

robbbert 10-11-2006 12:38 PM

Additional hints (for the command line) (check them at any rate!):

Quote:

which java

sudo update-alternatives --config java

echo $JAVA_HOME
export JAVA_HOME = /path/to/jdk

echo $CLASSPATH
export CLASSPATH = /path/to/jdk/lib:/path/to/jdk/jre/lib/ext
My $HOME/.bashrc file (which gets interpreted everytime I logon) looks like that:
Quote:

export PATH=/usr/lib/j2sdk1.5-sun/bin:$PATH
export JAVA_HOME=/usr/lib/j2sdk1.5-sun
export CLASSPATH=/usr/lib/j2sdk1.5-sun/lib:/usr/lib/j2sdk1.5-sun/external-jars:/usr/lib/j2sdk1.5-sun/jre/lib/ext
export JBOSS_HOME=/media/hde1/home/robert/opt/jboss-4.0.4.GA

Carunkumar 10-12-2006 07:18 AM

Thanks for you help:newbie:newbie: .But I didn't understand the commands you posted.
What is it used for?


-Arunkumar C

IBall 10-12-2006 08:14 AM

1) "which java" - gives the path the the command java. In some cases, you may have several executables called "java" and this command tells you which one you are executing.

2) See "man update-alternatives" for a good description.

3) The next commands simply print (echo) the value of the environment variables "$JAVA_HOME" and "$CLASSPATH". They should be set correctly if you installed using the package.

4) The export commands let you set these environment variables if necessary, though I wouldn't bother with this at the moment.

5) Your ~/.bashrc is a config file that is read everytime you start a new shell (that is not a login shell). Those lines will set those environment variables to the correct values when you start a shell. Don't worry about this though, they should be set correctly by the package installer.

I hope this helps
--Ian

PS: Google would have given you good answers to all of these...

Carunkumar 12-22-2006 11:44 AM

Thanks a lot!

snowman81 12-23-2006 11:33 PM

I don't know if Easy Ubuntu (I think that's the name) has it but I know Automatix2 does. Even has a GUI now.

fragos 12-24-2006 05:35 PM

Java5 installs easily with the Synaptic Package Manager. No command line required. There are also a number of development environments. Eclipse is a popular one.

Carunkumar 12-25-2006 01:22 AM

Thank you!


All times are GMT -5. The time now is 07:28 AM.