Install JDK on OpenSolaris and configure the java Development Environment

Source: Internet
Author: User

To install and run the JAVA environment on OpenSolaris (OS), it is very difficult for me who have never been familiar with unix. Although I thought it was very simple on windows, it was just a matter of minutes ),

Now, let's get started:

1. The operating environment of java has been installed on the OS, but there is no compiling environment. In fact, the old version is not too old, but you are too lazy to find the same version, which is directly the latest)

Installation skipped, see http://www.oracle.com/technetwork/java/javase/install-solaris-139361.html#install-pkg

There are two packages. As a cainiao, I chose the. sh binary installation package.

By the way, the installation will fail due to insufficient permissions. sh (copy the jdk installation file to the installation directory you need, except/export/home/[your user name]/if you choose to install it in this directory, skip this step)

Enter the command line, enter su, press enter, and enter the root password to copy your. sh file to the directory to be installed.

Here, I chose/usr/jdk/instances as the installation directory, which affects all users)

Delete all files under/usr/jdk/instances/, but I am afraid of conflict and have not tried it. You can skip this step and try again)

Then follow the installation steps Step by Step (must be executed after su)

2. Configure environment variables. Many of them are found online to modify the/etc/profile file.

Export JAVA_HOME = Your jdk installation directory

Export PATH = $ PATH: $ JAVA_HOME

Export CLASSPATH =.: $ CLASSPATH: $ JAVA_HOME

However, after I tried it N times, none of the PATH variables can be executed,

Finally, I found a solution on a website, which means that the modification can also be done in this file, but it is not recommended, finally, select/export/home/[your username. profile

Export JAVA_HOME = Your jdk installation directory

Export PATH = $ PATH: $ JAVA_HOME

Export CLASSPATH =.: $ CLASSPATH: $ JAVA_HOME

 

Save, log out, and log on again. Run the java-version command to check whether it is your installed version, and run the javac command to check whether it is OK. If there is no problem, do it!

This article is from the "Moon wolf smoke" blog, please be sure to keep this source http://langyan.blog.51cto.com/1708932/409759

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.