Java Environment variables detailed settings

Source: Internet
Author: User

1.Windows under Configuration

A. Download JDK, now most of the enterprise use JDK1.7, no hesitation, download the Sun website jdk. Note: X86 is used by 32-bit systems, X64 is used by 64-bit systems, do not consider compatibility, choose the appropriate version according to your system type.

B. Double-click to run the downloaded file.

C. Select the directory, Note that if you do not want to install in the C drive, be sure to install Java in the English directory, the parent directory can not be nested in Chinese.

D. All the way next, appear select the JRE installation directory, select the directory specified in step c.

E. Start configuring environment variables, right-click My Computer---properties-----advanced---environment variables,

F. Select "New System Variable"--pop up the "New System Variable" dialog box, enter "Java_home" in the "Variable name" text box, enter the installation path of the JDK in the "Variable Value" text box (that is, the folder path of step c, note the path to reach **\java\jdk1.7.0_ 25 this position), click the OK button,

G. View the path variable in the system variables options area, if it does not exist, create a new variable path, otherwise select the variable, click the Edit button, add "%java_home%\bin;" At the beginning of the Variable Value text box, click the OK button,

H. Now the test environment variable is configured successfully or not. Enter "JAVAC" in the DOS command line window and the output Help information is configured correctly.

2.Linux under Installation:

A. Download *.tar.gz Free Install package

B. Unzip using the command line:

[Email protected] soft]$ tar zxvf jdk-7u75-linux-x64.tar.gz

C. Creating a folder with root privileges

Command line:

[email protected] soft]$ su
Password:
[Email protected] soft]# mkdir/usr/java/

D. Move a folder

[Email protected] soft]# mv./jdk1.7.0_75//usr/java/

E. Editing environment Variables/etc/profile

[Email protected] soft]# Vim/etc/profile

F. Add the following to the first line of the file:

#jdk1.7
Java_home=/usr/java/jdk1.7.0_75
Jre_home=/usr/java/jdk1.7.0_75/jre
Path= $PATH: $JAVA _home/bin: $JRE _home/bin
Classpath=.: $JAVA _home/lib/jt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Export Java_home jre_home PATH CLASSPATH

G. Update the Environment, command:

[Email protected] soft]# Source/etc/profile

H. Input Javac Test:

Usage:javac <options> <source files>
Where possible options include:
-G Generate All debugging Info
-g:none Generate No debugging Info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate No warnings ...

I. Success!

Thank you for reading my blog, due to the author's limited, mistakes are unavoidable, I hope to get your criticism correct, I wish you good work, learning smoothly!

############################################################

Reprint please indicate the source, thank you! Original address: http://www.cnblogs.com/masonwang/p/4527049.html

############################################################

Java Environment variables detailed settings

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.