Java memory model, Java memory management, Java heap and stack, and garbage collection
1. win7 configuration
First Download jdk that meets the operating system version, such as the latest jdk 8:
Download link: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-4243151.html;
Of course, developers generally do not have the latest Jdk. the mainstream options are Jdk 6 and Jdk 7. of course, more and more developers are switching to the Jdk 8 platform.
After the download, install the jdk on the local machine. the installation path is C: \ Program Files \ Java \ jdk1.7.0 _ 79.
Perform the following steps: computer -- properties -- advanced system settings -- environment variables
In the environment variable of xxx (xxx represents your computer name), create JAVA_HOME (this name is customized, but this is common) and enter the value
Click OK. Windos key + r, enter cmd
Enter the java-version command. if you can see the java-related version information, the java environment variable is successfully configured.
2. linux environment variable configuration
Linux and Windows 7 are multi-user operating systems. Therefore, the location where environment variables are configured indicates the scope of the environment variables.
As I configured bai for Windows 7 above, the java environment can be used only when bai users log on. Other users will not be able to use the environment. of course, if your configuration is on system variables, all users on this computer will be able to use this environment. After getting familiar with this concept, it is easy to configure environment variables on linux.
Linux and Windows 7 are multi-user operating systems. Therefore, the location where environment variables are configured indicates the scope of the environment variables.
As I configured bai for Windows 7 above, the java environment can be used only when bai users log on. Other users will not be able to use the environment. of course, if your configuration is on system variables, all users on this computer will be able to use this environment. After getting familiar with this concept, it is easy to configure environment variables on linux.
Step 1: Download
Download the jdk of the corresponding linux version to/usr/local, and decompress the package:
$ Wget tar-zxvf jdk-8u66-linux-x64.tar.gz $ mv jdk1.7.0 _ 79 jdk1.7 # Rename
Obtain the Jdk directory/usr/local/jdk1.7.
Step 2: configure the java environment for all users
Log on to vim/etc/profile as the root user
Press the insert key, move to the last row, and add
#configuration java development enviroumentexport JAVA_HOME=/usr/local/jdk1.7export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Press esc and enter wq. after exiting, enter java-version. if the corresponding version information is displayed, the java environment variable is successfully configured.
Step 3: configure the java environment for the current user
Vim ~ /. Bash_profile file
Add the following information:
#configuration java development enviroumentexport JAVA_HOME=/usr/local/jdk1.7export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Log on again. There are two common methods.