Jdk installation process in Debian system

Source: Internet
Author: User
I downloaded the latest JDK at sun, and I downloaded the jdk-6u18-linux-i586.bin and changed the file's properties to executable, directly execute the file # chmod + xjdk-6u18-linux-i586.bin #. /after the jdk-6u18-linux-i586.bin program runs, a directory named jdk1.6.0 _ 18 will be generated under the current directory to copy the directory to/u

I downloaded the latest JDK at sun, and I downloaded the jdk-6u18-linux-i586.bin and changed the properties of the file to executable, directly execute the file

# Chmod + x jdk-6u18-linux-i586.bin

#./Jdk-6u18-linux-i586.bin

After the program runs, a directory named jdk1.6.0 _ 18 is generated under the current directory.

Copy the directory to/usr/local/jdk1.6.0 _ 18 and add the following two environment variables to the system initialization script:
Cp-r/home/jason/Download/jdk1.6.0 _ 18 // usr/local/

Gedit/etc/profile

Export JAVA_HOME =/usr/local/jdk1.6.0 _ 18
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH
ExportCLASSPATH =.:/usr/local/jdk1.6.0 _ 18/lib:/usr/local/jdk1.6.0 _ 18/jre/lib: $ CLASSPATH

Set default Startup
Gedit/etc/rc. local
Add:
Export JAVA_HOME =/usr/local/jdk1.6.0 _ 18
ExportPATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH: $ CATALINA_HOME =/usr/local/apache-tomcat-6.0.26/bin
ExportCLASSPATH =.:/usr/local/jdk1.6.0 _ 18/lib:/usr/local/jdk1.6.0 _ 18/jre/lib: $ CLASSPATH
Export CATALINA_BASE =/usr/local/apache-tomcat-6.0.26
Export CATALINA_HOME =/usr/local/apache-tomcat-6.0.26
Export JRE_HOME =/usr/local/jdk1.6.0 _ 18/jre

Test with java-version command

Java installed in the traditional way is not integrated into the Debian software package system, so there is no java dependency information in the Debian software package database. The Debian software package management program cannot be used for management and can only be manually maintained. That is to say, if we want to delete java, we can only manually delete directories and environment variables.
2. Debian method (not tested)
###################
Use the make-jpkg program provided by the java-package to generate a Debian package from SUN's official java package.

First install java-package and fakeroot

# Apt-get install java-package

# Apt-get install fakeroot

Download the official java software package and use the following command to generate a java software package in Debian format. Note that the make-jpkg program cannot run in the root environment. we need to use the fakeroot program.

# Cp jdk-6u18-linux-i586.bin/home/gongora/

# Chown gongora jdk-6u18-linux-i586.bin

# Su gongora

# FAK eroot make-jpkg jdk-6u18-linux-i586.bin

An error occurs:

Creating temporary directory:/tmp/make-jpkg.uVWRTO8655
Loading plugins: blackdown-j2re.shblackdown-j2sdk.sh common. sh ibm-j2re.sh ibm-j2sdk.sh j2re. shj2sdk-doc.sh j2sdk. sh j2se. sh sun-j2re.sh sun-j2sdk-doc.shsun-j2sdk.sh
Detected Debian build architecture: i386
Detected Debian GNU type: i486-linux-gnu
No matching plugin was found.
Removing temporary directory: done

I found that the installation script of the original java-package does not recognize the file name of the latest jdk installation file.

/Usr/share/java-package/sun-j2sdk.sh, which has a section

"Jdk-6u" [0-9] "-linux-i586.bin") # SUPPORTED
J2se_version = 1.6.0 + update $ {archive_name: 6: 1 }$ {revision}
J2se_expected_min_size = 130
Found = true

That is used to identify the bininstallation file for jdk1.6, but note that the "jdk-6u" [0-9] "-linux-i586.bin" clause causes it to recognize only. binfiles below the jdk-6u9 version

Change this sentence to "jdk-6u" [0-9] [0-9] "-linux-i586.bin ")

Repackaging OK

A Debian package sun-j2sdk1.6_1.6.0 + update0000i386.deb is generated in the current directory

Install the software package as root

# Su root

# Dpkg? I sun-j2sdk1.6_1.6.0 + update0000i386.deb

Finally, set the java environment variable and add/etc/profile at the end.

PATH =/usr/lib/j2sdk1.6-sun/bin: $ PATH

JAVA_HOME =/usr/lib/j2sdk1.6-sun/

CLASSPATH =.:/usr/lib/j2sdk1.6-sun/jre/lib

Export PATH

Export JAVA_HOME

Export CLASSPATH

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.