LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-04-2007, 12:22 PM   #1
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
Java in Ubuntu


I've just installed the sun jdk for a course I was doing. When the installation had finished, I set about checking it out, and noticed that each of the component tools (java, javac..) exists as symbolic link in /usr/bin, whose target is a symbolic link in /etc/alternatives, whose target is the tool itself.

This seems overly complicated to me. Is there an advantage in doing it this way? I am tempted to link from /usr/bin/<tool> straight to the appropriate file in the java folder in /usr/lib.

Yours,
Rob
 
Old 02-04-2007, 12:59 PM   #2
lanmanners
LQ Newbie
 
Registered: Jul 2004
Posts: 26

Rep: Reputation: 15
Cool Which version of Ubuntu?

Hi Rob,

Which version of Ubuntu are you using?

If it's dapper (6.06) or above, then you are better off installing the precompiled ubuntu packages. I would recommend that you remove the JDK which you have installed and then install the ubuntu ones with:

Code:
apt-get install sun-java5-jdk
update-alternatives --config java
You will just need to accept the license during installation and that's it, you're up and running.

On the other hand you can continue to maintain your existing version, but I can't guarantee you will be able to get it to work easily. The /etc/alternatives dir is a more organized way of handling symlinks for multiple versions of one program (Sun Java, GCJ, Blackdown Java...) and linking /usr/bin/java* to appropriate binaries may cause problems with programs that depend on it (don't know of any programs at this time).

You can try the "update-alternatives" script but with parameters that point to your JDK installation.

There is of course, the fully detailed JAVA Howto for DEbian Ubuntu available here

Hope that helps.
--LM
 
Old 02-04-2007, 02:28 PM   #3
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Original Poster
Rep: Reputation: 97
Thanks for the reply.

Actually, I installed via Synaptic from the repository, so it is the "official" Ubuntu version. Some of the symlinks were created/changed to point to the Sun tools (e.g. javac), while others were left pointing to the gcj ones.

After changing the link targets, java is generally working, but I'm having another (little) problem, in that sound isn't. A program which uses sound throws the following error:

line unavailable javax.sound.sampled.LineUnavailableException: Audio Device Unavailable

Edited to add: Actually, I've just solved that, though I don't really understand why I was getting the error. The solution was to change the ownership of the jar containing the sound file to my user account (from root). However, it had read and execute permissions set already, so should have worked, I would have thought.

Yours,
Rob

Last edited by Robhogg; 02-04-2007 at 02:43 PM.
 
  


Reply

Tags
java



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Opera Java biojayc Linux - Software 4 09-29-2011 03:54 PM
ubuntu java Clarence27 Ubuntu 5 02-12-2007 06:34 AM
Ubuntu Wi-fi and Java help help kol.klink Linux - Newbie 4 10-20-2006 09:33 AM
java in ubuntu Clarence27 Linux - Newbie 5 09-04-2006 02:33 PM
Install Java on Ubuntu tfm1 Linux - Software 1 06-26-2006 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 03:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration