Installing Java on Debian
Can’t figure out how to get Java installed on your Debian system to view thosy fancy webcams and other java applications on websites. Here you go:
First, collect the necessary files:
For the JRE (or JDK) file, go to the Java download site. The file you want will be called something like jre-1_5_0_05-linux-i586.bin (just make sure it ends in .bin).
Next, install Java on your Debian system:
- Log in as root.
- Edit your /etc/apt/sources.list, add "contrib" to your mirror definitions. Something like this:
deb http://ftp.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free
deb-src http://ftp.us.debian.org/debian stable main contrib non-free
deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
You will probably have another mirror which is OK. Just make sure the "contrib" is there.
- DO "apt-get update" on the command line, and press Enter. You may also want to try "apt-get dist-upgrade" to have all packages on your system upgraded to their latest versions.
- Do "apt-get install java-package" to get the tools needed to install Java.
- Log in as the normal (unprivileged) user and go to the folder of the downloaded file (probably the home folder assuming you downloaded it as that user).
- Do "fakeroot make-jpkg jre-1_5_0_05-linux-i586.bin". You will be assked a bunch of questions to which you can just accept the default by pressing Enter. You will also have to agree to Sun's License agreement.
- It will take a few minutes, and you will see a bunch of errors and stuff, but don't worry. When it is finished and your command prompt reappears, there should now be a file called sun-j2re1.5_1.5.0+update05_i386.deb (or something similar) in that folder.
- Or if you don't want to learn anything and just download the .deb file you can get it here
- Log in as root.
- Do "dpkg -i sun-j2re1.5_1.5.0+update05_i386.deb" (or whatever your file is called) to install the JRE (or JDK).
- To test your Java installation do "java -version". It will print out a message like this:
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
- Now Java has been successfully installed. Try and go to one of those fancy Java enabled sites and surf away!
If you ever want to remove Java do "apt-get remove --purge sun-j2re1.5". It will also remove most packages that depend on Java. Keep the .deb file, you can use it to install the JRE (or JDK, if that is what you picked) on other systems.


Recent comments
51 weeks 6 days ago
1 year 10 weeks ago
1 year 10 weeks ago
1 year 15 weeks ago
1 year 21 weeks ago
1 year 24 weeks ago
1 year 36 weeks ago
1 year 36 weeks ago
1 year 36 weeks ago
1 year 51 weeks ago