Home  >  Article  >  Backend Development  >  FreeBSD9.0 installs JDK1.6

FreeBSD9.0 installs JDK1.6

WBOY
WBOYOriginal
2016-08-08 09:29:551127browse

FreeBSD9.0 install JDK1.6

小wolf@http://blog.csdn.net/xiaolangyangyang

Today I encountered a problem when installing jdk1.6 on FreeBSD 9.0. I would like to share it with you here. I hope it will be helpful to everyone.

1. Download the file

Install according to the official plan, but you need to manually download some jars and zips during the installation process. I also posted the address below:

#wget http:// www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-src-b05-jrl-24_sep_2007.jar

#wget http://www.java.net/download/jdk6 /6u3/promoted/b05/jdk-6u3-fcs-bin-b05-jrl-24_sep_2007.jar

#wget http://www.java.net/download/jdk6/6u3/promoted/b05/jdk- 6u3-fcs-mozilla_headers-b05-unix-24_sep_2007.jar

Downloadbsd-jdk16-patches-4.tar.bz2 (http://www.eyesbeyond.com/freebsddom/java/JDK16JRLConfirm .html)

Download diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2 (http://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo- caffe-freebsd6-i386-1.6.0_07-b02.tar.bz2)

The following one is the most interesting to download. There will be different versions when installing. If you use other versions instead, when installing It will not pass, so how can I download the specific version?

Answer: You only need to make small modifications to the link below and change the number after tzupdater/ to the version number prompted during installation, so that you can download the version you want.

wget http://download.oracle.com/otn-pub/java/tzupdater/1.3.42/tzupdater-1_3_42-2011k.zip

After the above 6 files are downloaded, upload them to Under /usr/ports/distfiles.

2. Installation

Go to the jdk installation directory: /usr/ports/java/jdk16/ and execute the following command: make install to install;

ok The installation is complete;

3. Configuration

Start configuring environment variables;

I won’t go into details here. What you need to remind is that depending on the shell you use, the files that need to be modified will be different;

If you are using sh, then what needs to be modified is .profile

If you are using csh, then the modification is .cshrc

complete;

Then add the following information to /etc/profile:

export PATH=$PATH :/usr/local/jdk1.6.0/bin/:/usr/local/jdk1.6.0/jre/bin

export JAVA_HOME=/usr/local/jdk1.6.0

export CLASSPATH="./:/usr/local/jdk1.6.0/lib:/usr/local/jdk1.6.0/jre/lib"

export LD_LIBRARY_PATH=/usr/local/jdk1 .6.0//jre/lib/i386:/usr/local/jdk1.6.0/jre/lib/

or caiySet environment variables (~/.cshrc):

Edit in the root directory .cshrc, add the following lines:

setenv JAVA_HOME /usr/local/java

setenv CLASSPATH $JAVA_HOME/lib:$JAVA_HOME/jre/lib

setenv PATH $JAVA_HOME/bin: $ JAVA_HOME/jre/bin:$PATH

4. Test

Make the environment variables effective and test:

source ~/.cshrc

java -version

Display:

java version "1.6.0_03-p4"

Java(TM) SE Runtime Environment (build 1.6.0_03-p4-zdhfree_09_jun_2008_10_38-b00)

Java HotSpot(TM) Client VM (build 1.6.0_03-p4-zdhfree_09_jun_2008_10_38-b00, mixed mode)

Problems encountered in actual operation:
1. Install wget: (After installing wget, /usr/ports/ distfiles)
$cd /usr/ports/ftp/wget

$make install clean

The above introduces the installation of JDK1.6 in FreeBSD9.0, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn