jdk1.7 FAQ:
1. Why does jdk1.7 not need to configure classpath?
Since I started learning Java, I have never set up a classpath. Initially, before Java 1.2, I needed a classpath to find the tools.jar, rt.jar and other files that come with it before I can run them.
2. JDK1.7 usage tutorial, how to write and run java programs?
1) Create a shortcut to the command prompt on the desktop
2) Right-click the command prompt and select Properties to create the starting position of the command prompt. You can also place it in another position, but be careful to put the program you write in the created position.
3) Create a new text file and write the HelloWord program
4) Save the text file as HelloWord.java file. Note that the naming of the document must be consistent with the class name in the program.
5) Enter javac HelloWord.java in the command prompt to compile the program to generate the HelloWord.class document. You can enter dir to view it.
6) Run the program and enter java HelloWord
How to use jdk1.7:
1. Right-click Computer→Properties→Advanced System Settings→Advanced→Environment Variables
2. System variables → New
Variable name: JAVA_HOME
Variable value: (Variable value fills in the installation directory of your jdk, for example, I am E:Javajdk1.7.0)
3. Find the Path variable in the system variables and select Edit
Enter %JAVA_HOME% in;%JAVA_HOME%jre in; at the end of the variable value.
(Note that if the original Path variable value does not have a ; sign at the end, enter the ; sign first and then enter the above code)
4. System variables → New
Variable name: CLASSPATH
Variable value: .%JAVA_HOME%lib;%JAVA_HOME%libools.jar (note the dot at the front)
At this point, the system variables are configured.
jdk1.7 features:
1. Strings can be used in switch
2. The use of "<>" List tempList = new ArrayList<>(); that is, automatic inference of generic instantiation types
3. Syntax supports collections, not necessarily arrays
4. Added some new tools and methods for obtaining environmental information
5. Boolean type inversion, null pointer safety, participating in bit operations
6. equals between two chars
7. Safe addition, subtraction, multiplication and division
jdk1.7 installation steps:
1. Download the software from this site, compress it and double-click the .exe to enter the installation wizard and click "Next" to continue.
2. Select the installation location. It is recommended to install the file on the D drive. Click "Next" to continue.
3. Component registration is being updated, please wait patiently.
4. Install the file on the D drive and click "Next" to continue.
5. The Java runtime environment is being registered. The process is very fast. Please wait.
6. The software has been successfully installed. Click on the next steps to access tutorials and more.
jdk1.7 update log:
1. Optimized some functions
2. Solved many unbearable bugs
Huajun editor recommends: jdk1.7 is the basis for the Java development platform to develop applications. It is the core part of jave. All java is built on the JDK. jdk1.7 is an indispensable piece of software, and its operating efficiency is also very high. It is worth using by everyone. In addition, Java JDK API and Java Development Kit are recommended to everyone. You are welcome to download and use them. |
it works
it works
it works