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