It used to be a real pain to install Java on most versions of Linux, but now that Sun has modified the license, there are some easier ways to install Java.
On Debian/Ubuntu Linux for example all you need to do is make sure that your apt-get is pointed at the right place. In your /etc/apt/sources.list add in the following (and make sure you are okay with adding in stuff that is not in the default environment).
After this the rest of the process will display a dialog that will require you to accept the license agreement. When you do, the rest of the setup will happen on its own.
When you're on the command prompt type
javac -version
or
java -version
You should be good to go! Finally we have an easy way to install Java on the various Linux variants without having to fight with fakeroot and the other foolishness. Took Sun a criminally long time to do this, but I certainly thank them for it.
Thanks for posting a good article, which i have been searching from last one week. I have installed Ubuntu 5.1 on my box and with that java 1.4 comes defaultly. So i wanna upgrade to 1.5, but have no idea. Previously i worked with RedHat linux, and now i have to try Deb/Ubuntu also.
Once i tested this work, get back and post my reviews.
Actually I like how JDKs can currently be installed on linux. Run a .bin file and it'll extracted the jdk in the current directory. Set your path and java home and that's it.
I find this particulary nice in comparison with a windows JDK installation, where you have to work through a seperate JRE and JDK installation, registry entries and the PATH env variable to find out why it works differently as it should.
Anyway from an end user view installing und updating via apt is a nice alternative, but I'll stick with the .bin files...
The .bin file doesn't register the Java install with the packaging system. On the other hand, downloading the .deb's from the repository integrates the Java install with the packaging system. The real benefit comes when you later want to install Java applications from the repository, which have a dependency on Java being installed. Since the packaging system knows Java is already there it can just install the application.
I figured that would be the case. Is there a way I can have 6.0 installed and still fake out the package manager into thinking I have the Java dependancy installed?
Last fall when I tried the fakeroot/make-jkpg trick on Mustang as-it-existed-then, that didn't work. I haven't tried since. You could try it and maybe it'll work. The only way I know to get the java dependency installed today is the Tiger packages.
Does anyone know how to install JAI (Java Advanced Imaging) under Ubuntu? I've been trying to install this for weeks and I can't get it to work. I need this to run so that I can install Jomic.
Anyone who can help me out, please post the info.
If anyone can figure out how to install JAI, then please let us all know.
There certainly have been performance issues with Java.
We've been working really hard on them.
The primary way we've attacked the problem is with advanced virtual machines. The performance
has been getting very nice. --James Gosling, 1999.
This is how I install Java 6 on Edgy (which has Java 5 only in Edgy's repositories):
Open /etc/apt/sources.list and replace edgy with feisty.
Run:
sudo apt-get update
sudo apt-get autoremove sun-java5-jdk
sudo apt-get install sun-java6-jdk
Open /etc/apt/sources.lst again and replace feisty with edgy. Again, update the repositories with sudo apt-get udpate.
I don't know how reliable it is to use Java 6 like this, but I have Intellij Idea 6.0.4 and Oracle SQL Developer and both run fine for a long time with this Java 6.
Hi, I tried to follow these instructions, which worked fine until I got to the command:
sudo apt-get install sun-java5-jdk
at which time I got the following errors:
E: Dynamic MMap ran out of room
E: Error occurred while processing zorp-modules (NewVersion1)
E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_dapper_universe_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
Installing Java on Ubuntu Linux
At 7:57 AM on May 25, 2006, Gregory Pierce
wrote:
Fresh Jobs for Developers Post a job opportunity
On Debian/Ubuntu Linux for example all you need to do is make sure that your apt-get is pointed at the right place. In your /etc/apt/sources.list add in the following (and make sure you are okay with adding in stuff that is not in the default environment).
deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse
After this have apt updates its repository
sudo apt-get update
And finally, just tell it to install java
sudo apt-get install sun-java5-jdk
After this the rest of the process will display a dialog that will require you to accept the license agreement. When you do, the rest of the setup will happen on its own.
When you're on the command prompt type
javac -version
or
java -version
You should be good to go! Finally we have an easy way to install Java on the various Linux variants without having to fight with fakeroot and the other foolishness. Took Sun a criminally long time to do this, but I certainly thank them for it.
13 replies so far (
Post your own)
Re: Installing Java on Ubuntu Linux
Hi Greg,Thanks for posting a good article, which i have been searching from last one week. I have installed Ubuntu 5.1 on my box and with that java 1.4 comes defaultly. So i wanna upgrade to 1.5, but have no idea. Previously i worked with RedHat linux, and now i have to try Deb/Ubuntu also.
Once i tested this work, get back and post my reviews.
Cheers,
Uday Garikapati
Re: Installing Java on Ubuntu Linux
Thanks, I needed this info too!Re: Installing Java on Ubuntu Linux
Actually I like how JDKs can currently be installed on linux. Run a .bin file and it'll extracted the jdk in the current directory. Set your path and java home and that's it.I find this particulary nice in comparison with a windows JDK installation, where you have to work through a seperate JRE and JDK installation, registry entries and the PATH env variable to find out why it works differently as it should.
Anyway from an end user view installing und updating via apt is a nice alternative, but I'll stick with the .bin files...
Re: Installing Java on Ubuntu Linux
You might want to think further about that.The .bin file doesn't register the Java install with the packaging system. On the other hand, downloading the .deb's from the repository integrates the Java install with the packaging system. The real benefit comes when you later want to install Java applications from the repository, which have a dependency on Java being installed. Since the packaging system knows Java is already there it can just install the application.
Re: Installing Java on Ubuntu Linux
Any idea on how this can be applied to 6.0? I'm assuming that it's probably not in the universal repository yet.ActiveObjects: an Easier Java ORM; Fuse: Resource Injection for Java
Re: Installing Java on Ubuntu Linux
Patience. You're right, Mustang is not packaged this way as yet. We'll take care of that when Mustang is finished.By the way we just posted a tutorial on installing Tiger on Dapper Drake.
Re: Installing Java on Ubuntu Linux
I figured that would be the case.ActiveObjects: an Easier Java ORM; Fuse: Resource Injection for Java
Re: Installing Java on Ubuntu Linux
Not that I know of.Last fall when I tried the fakeroot/make-jkpg trick on Mustang as-it-existed-then, that didn't work. I haven't tried since. You could try it and maybe it'll work. The only way I know to get the java dependency installed today is the Tiger packages.
Re: Installing Java on Ubuntu Linux
Does anyone know how to install JAI (Java Advanced Imaging) under Ubuntu? I've been trying to install this for weeks and I can't get it to work. I need this to run so that I can install Jomic.Anyone who can help me out, please post the info.
If anyone can figure out how to install JAI, then please let us all know.
You can download JAI from:
http://java.sun.com/products/java-media/jai/downloads/download-1_1_2_01.html
You can view the install instructions for JAI at:
http://java.sun.com/products/java-media/jai/INSTALL-1_1_2_01.html
Re: Installing Java on Ubuntu Linux
The following link will help you how to install java on Ubuntu Linux.http://blog.agileware.net/index.php/archives/2005/09/30/how-to-install-java-on-ubuntu-linux/
Re: Installing Java on Ubuntu Linux
This is how I install Java 6 on Edgy (which has Java 5 only in Edgy's repositories):Open /etc/apt/sources.list and replace edgy with feisty.
Run:
sudo apt-get update
sudo apt-get autoremove sun-java5-jdk
sudo apt-get install sun-java6-jdk
Open /etc/apt/sources.lst again and replace feisty with edgy. Again, update the repositories with sudo apt-get udpate.
I don't know how reliable it is to use Java 6 like this, but I have Intellij Idea 6.0.4 and Oracle SQL Developer and both run fine for a long time with this Java 6.
Re: Installing Java on Ubuntu Linux
Hi, I tried to follow these instructions, which worked fine until I got to the command:sudo apt-get install sun-java5-jdk
at which time I got the following errors:
E: Dynamic MMap ran out of room
E: Error occurred while processing zorp-modules (NewVersion1)
E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_dapper_universe_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
Any advice?
Thanks so much-
Matt
Re: Installing Java on Ubuntu Linux
Thanks for you tips. Now I can use the java on Ubuntu.I hopw the Ubuntu can inculde the jave when releasing.