Dashboard > Development > Java on Debian > Information > Page Comparison
Development Log In   View a printable version of the current page.
Java on Debian
compared with
Current by Brandon Philips
on Jun 29, 2005 20:41.

(show comment)
 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 2 changes. View first change.

  
  
 h2. Outdated
 As the comments suggest this document is now outdated. A much more streamlined way to install Java is to:
  
 * Grab: http://java.sun.com/j2se/1.5.0/download.jsp
 * apt-get install java-package fakeroot
 * fakeroot make-jpkg jre-1_5_0_02-linux-i586.bin
 * dpkg -i sun-j2re1.5_1.5.0+update02_i386.deb
 * logout and login again and check java
 * java -version
  
 More information on this method can be found here:
 http://serios.net/content/debian/java/with-java-package.php#gettingstartedsarge
  http://serios.net/content/debian/java/with-java-package.php
  
 h2. Historical Documentation (still useful for Woody)
  
 The following document should lead you by the hand and help you install Java on your box. The reason this isn't a script is because the Java installer seems to change every version, and it doing it by hand is a stepping stone to installing alternative JVMs. So hopefully you get a working install and learn a little about Debian and Java while doing it.
 h2. Grab the Java SDK
 [Sun Java J2SE SDK|http://java.sun.com/j2se/1.4.2/download.html] (1.4.2_04) You want the SDK *and* Documentation
 h2. Installation
 Note: Substitute correct version numbers for packages and files when installing future versions.
 h3. Upgrade Debian to the latest packages
 {code}apt-get update
 apt-get -u upgrade
 apt-get -u dist-upgrade{code}
 h3. Install Debian packages for handling unpackaged software.
 {code}apt-get update
 apt-get install kaffe equivs java-common java2-common{code}
 h3. Install Java SDK
 # Download J2SE SDK components to {code}/var/install/java/1.4.2{code}
 # Change to install dir: {code}cd /var/install/java/1.4.2{code}
 # Make sure you have write permissions to the directory.
 # Make installer executable: {code}chmod a+x j2sdk-1.4.2_04-linux-i586.bin{code}
 # su to root: {code}sudo su{code}
 # Run the installer: {code}./j2sdk-1.4.2_04-linux-i586.bin{code}This will create the directory j2sdk1.4.2_04 with many files and directories in it.
 # Unzip the docs (you *did* download the docs from the Java website didn't you?): {code}unzip j2sdk-1.4.2-doc.zip{code} This will create the directory docs.
 # Move the docs into the SDK: {code}mv docs j2sdk1.4.2_04{code}
 # su to root: {code}sudo su{code}
 # Change the ownership of the java files: {code}chown -R root:src j2sdk1.4.2_04{code}*Note: root should own all system files like java. The group src is short for source as in code. That's the group we are using for users allowed to compile source code.*
 # Move the SDK directory tree to the final runtime location: {code}mv j2sdk1.4.2_04/ /usr/local/lib/{code}
 # Create link: {code}ln -s /usr/local/lib/j2sdk1.4.2_04 /usr/local/lib/jdk{code} *Note: This link should be used everywhere to refer to the path of the JDK and JRE. Always use /usr/local/lib/jdk... and do not use /usr/local/lib/j2sdk1.4.2_04. This allows easier upgrading in the future and multiple versions of java to be installed simultaneously.*
 # Tell Debian that java has been installed. Use the "dummy" package control files provided by java-common to satisfy Debian packing dependencies. *NOTE: if you are OSUOSL 'apt-get install java2-compiler-dummy java-compiler-dummy java2-runtime-dummy java-virtual-machine-dummy' and skip to 15.*{code}
 cd /var/install/java
 mkdir pkg
 cd pkg
 cp /usr/share/doc/java-common/dummy-packages/*.control /var/install/java/pkg/
 equivs-build java-compiler-dummy.control
 equivs-build java-virtual-machine-dummy.control
 equivs-build java2-runtime-dummy.control
 equivs-build java2-compiler-dummy.control
 {code}
 # You should now have 5 packages in /var/install/java/pkg. Install them with dpkg: {code}
 dpkg -i java-compiler-dummy_1.0_all.deb java-virtual-machine-dummy_1.0_all.\
 deb java2-compiler-dummy_1.0_all.deb java2-runtime-dummy_1.0_all.deb
 {code}
 # Tell Debian to use our new JDK: [Run this shell script|^update-java-defaults.sh] * NOTE: The command update-alternatives is used in Debian to choose which of several packages to use when several can do the same thing. ("Java" can be provided by kaffe, blackdown, and Sun, etc.) See "man update-alternatives" for details.*
 # Run java once as root (you're still root) to allow system preference directories to be created and check that Sun's java is running: {{java -version}}
 # Update the JAVA_HOME environment variable and the path in /etc/profile or /home/$USER/.bash_profile or /root/.profile: {code}
 export JAVA_HOME="/usr/local/lib/jdk"
 export JDK_HOME="${JAVA_HOME}"
 export PATH="${JAVA_HOME}/bin:${PATH}"
 {code}
 # To totally reset the environment variables, you need to reboot
 *NOTE: Leave the directory /var/install/java and its contents. You may need it again later for uninstallation*
  
 h2. Mozilla-Firefox Configuration
 Run the following command as root:
 {code}ln -s /usr/local/lib/jdk/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so \
 /usr/lib/mozilla-firefox/plugins/libjavaplugin_oji.so{code}
 h2. Mozilla Configuration
 Run the following command as root:
 {code}ln -s /usr/local/lib/jdk/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so \
 /usr/lib/mozilla/plugins/libjavaplugin_oji.so{code}
 h2. Getting Eclipse
 {code}apt-get install eclipse-sdk eclipse-source{code}
Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.7 Build:#524 Jul 28, 2006) - Bug/feature request - Contact Administrators