Generally speaking, JAVA environment installation is jdk, environment variables, javac, and other commands.
Then write a helloworld with a notepad for everyone to run, these are some of the necessary foundations of Java basics,
Personally, I think it can be used as theoretical knowledge to understand, but don't stick to it.
This article mainly allows you to complete the construction of the JAVA environment from the foundation of 0 as soon as possible and enter the code stage as soon as possible.
1. Environmental installation
1. First install the jdk, the installation package needs to be downloaded from the official website, now JAVA belongs to oracle's products, so the official website address is already under the oracle website:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Now the latest version is 8, due to personal habits, I generally don't use the latest, so download a 7, for more intuitive screenshots are as follows:
After downloading, double-click, it is the next step default, generally installed on the C drive, under the program file.
Don't worry about this, after the installation is completed, there will be two folders jdk and jre, what do they mean, please ask Du Niang yourself.
The owner needs to install two versions because of his work, and he can automatically ignore them.
2. Install the development tool eclipse, and personally use the Eclipse JAVA EE version. The address is as follows:
http://www.eclipse.org/downloads/
Download the JAVA EE version, download 32 or 64-bit according to your own machine, and unzip it after downloading, and unzip it in an English folder with each space
2. Code development
1. Next, open the eclipse shortcut, prompt to select a workspace, and select a location to create a new workspace folder as a workspace
2. Turn off the welcome interface
3. Next, start writing code and first establish a JAVA project
4. Select JAVA Project
5. Enter the project name, and the project name is lowercase. (The lowercase of the project name is just a specification, and the uppercase can also be run, but it is not recommended) In the future, the code specification will be interspersed in the process of explaining.
All naming should be as meaningful as possible:
Exercise items: I will take the test;
Customer Relationship Management System: CRM (CRM Customer Relationship Management System)
6. Just pop up yes
7. Then you will see such a directory structure:
test project name; src source code directory; JRE System Library JRE system package
The written JAVA file can be placed in the src directory;
8. Create a new class file HelloWorld.java the first letter of the class name is capitalized, and the first letter of the second word is capitalized
(Try to make the class name as meaningful as possible, the first letter of the class name is capitalized, and the first letter of each word is capitalized when there are multiple English words) Right-click on src, new ->class
9. Package name: the folder where the class is located, and the actual project is generally divided according to the business module.
Class name: Let's define it just now HelloWorld.java just enter HelloWorld here
Check the main method to automatically generate the main function
10. The structure of the generated directory is as follows:
11. The generated HelloWorld.java file is as follows, double-click the class file
12. Enter System.out.println("hello,world") into the main function; The details are as follows
package test;
public class HelloWorld {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("hello,world");
}
}
Once saved, right-click ->run as-> java application in the blank file
13. The console will display the output information of the code, as follows
Ok, the above is the java environment construction; As for friends who like to study the configuration of environmental variables, just ask Du Niang.
I, I will release some of the more I want you to get started with JAVA WEB development as soon as possible, but interested friends pay more attention, thank you, that's all for today
Also:
Personally, I am very uninterested in which people teach everyone to use notepads to write code, saying that this will enhance memory, efficiency is the most important in actual development, and now development tools will automatically display functions.
If you have to memorize it, wouldn't that be causing trouble for yourself? The leader won't give you time to memorize this thing.
|