您的位置:首页 > 编程语言 > Java开发

How to Install JDK 1.6 on a Solaris

2012-07-05 17:29 288 查看
Solaris is a Unix-based operating system designed and marketed by Sun Microsystems. Solaris can be used as a complete software production system, with Java being included. To write Java programs on a Solaris system, the Java Development Kit (JDK) must be installed.
The javac compiler can be used to compile all of your Java source files easily from the terminal of your Solaris system.

Instructions

1

Point your Web browser to the Java JDK download page (see Resource 1). Click on the download link in the listing located on the bottom half of the page that matches your specific Solaris machine type. If the system is running a 32-bit Intel or AMD processor,
click the link labeled "jdk-6u26-solaris-i586.tar.Z"; for SPARC systems less than Version 9, click "jdk-6u26-solaris-sparc.tar.Z"; for SPARC systems that are Version 9, click "jdk-6u26-solaris-sparcv9.tar.Z"; and for Intel or AMD systems that are 64-bit, click
"jdk-6u26-solaris-x64.tar.Z."

2

Read and agree to the Terms of Use provided on the page that appears after clicking your needed download link. Place a check mark in the box next to "I Agree" at the bottom of the agreement block.

3

Save the file to a directory of your choosing on your Solaris system. A good location is "/usr/bin." This directory can be typed in your browser download window when asking you where you would like the file to be saved.

4

Launch your Solaris console terminal screen and navigate to the directory in which you saved the downloaded JDK file. In this example, if you saved the file "jdk-6u26-solaris-i586.tar.Z" into the directory "/usr/bin," enter the following at the terminal
command prompt:

cd /usr/bin

5

Extract the files in the compressed file by entering the following command at the prompt, replacing the file name used here with the actual file name for the file you downloaded:

zcat jdk-6u26-solaris-i586.tar.Z | tar -xf -

Wait for the file to be completely extracted. When it is finished, you will receive a command prompt with a cursor marker indicating you can type further commands.

6

Change to superuser mode in the terminal by typing "su" at the command prompt, then pressing the "Enter" key on the keyboard. The next line will require you to enter your administrator password. Enter it, then press the "Enter" key on the keyboard.

7

Uninstall any currently installed version of Java by removing the package as follows:

pkgrm SUNWj6rtx SUNWj6dvx SUNWj6dmx

8

Install the new JDK 1.6 version by typing the following at the command prompt:

pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx

Wait for the package to become fully installed, at which time the command prompt will reappear waiting for additional commands to be entered.

9

Delete the downloaded compressed file to free up system space on your hard drive. Enter the following at the command prompt while still within the directory where it is located: "

rm jdk-6u26-solaris-i586.tar.Z

Replace the file name with the actual name of the file you are deleting.

Tips & Warnings

Always remove the currently installed version of Java before installing the latest version. Failure to do so can result in software conflicts on a Solaris system that can make the Java compiler inoperable.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息