1. Preface
JDK (Java Development Kit) is the basis of all java applications. It can be said that all java applications are built on this. It is a set of APIs, or it can be said to be some java class. The latest version that has been officially released is JDK1.3. Considering that I'm not familiar with linux and most of them are under MS systems, I'm using win2000 here.
2. Download and install
The download address is JAVA official site: it is also everywhere in China.
Under Windows, directly run the .exe file and install it in a directory. I use F:\jdk13 as an example here.
3. Configuration
Select "My Computer" on the desktop (right-click)
advanced
Environment variables
In "System Variables" ---> "New"
Enter: CLASSPATH in the variable name, and enter:
F:\JDK13\LIB\;F:\JDK13\LIB\;F:\JDK13\BIN; Then confirm;
OK, the configuration is completed, and the environment variables must be valid after restarting the computer.
4. Test
(1) Write a simple java program using a text editor:
public class HelloWorld {
public static void main(String args[]) {
("Hello World!");
}
}
This example is the famous "Hello World", which function is to display "Hello World".
Note: The file name must be "", and it is also case-specific. Careful friends will notice that it is the same name as the one after the public class.
(2) Compilation: Execute at the dos command prompt: (Note the case)
javac
If normal, the file will be generated.
(3) Run: Execute at the dos command prompt: (Note the case)
java HelloWorld
Here is a problem that Java beginners are likely to encounter (not afraid of jokes, so do I) which is input:
java
If there are too many .classes in the following, be sure to pay attention, otherwise the following error will occur:
Exception in thread "main" :HelloWorld/class
(I guess whether it was changed to "/" when java translated ".", or other reasons I don't know)
OK, running java HelloWorld should have a great "Hello World".
At this point, you have successfully configured the JDK and can start the Java process of long and painful (for friends like me who didn't understand Java before, you can use "pain" to describe it, concepts that you don't understand, and unfamiliar with Java API..., but don't worry, I will slowly get started with you and slowly improve......).
JDK (Java Development Kit) is the basis of all java applications. It can be said that all java applications are built on this. It is a set of APIs, or it can be said to be some java class. The latest version that has been officially released is JDK1.3. Considering that I'm not familiar with linux and most of them are under MS systems, I'm using win2000 here.
2. Download and install
The download address is JAVA official site: it is also everywhere in China.
Under Windows, directly run the .exe file and install it in a directory. I use F:\jdk13 as an example here.
3. Configuration
Select "My Computer" on the desktop (right-click)
advanced
Environment variables
In "System Variables" ---> "New"
Enter: CLASSPATH in the variable name, and enter:
F:\JDK13\LIB\;F:\JDK13\LIB\;F:\JDK13\BIN; Then confirm;
OK, the configuration is completed, and the environment variables must be valid after restarting the computer.
4. Test
(1) Write a simple java program using a text editor:
public class HelloWorld {
public static void main(String args[]) {
("Hello World!");
}
}
This example is the famous "Hello World", which function is to display "Hello World".
Note: The file name must be "", and it is also case-specific. Careful friends will notice that it is the same name as the one after the public class.
(2) Compilation: Execute at the dos command prompt: (Note the case)
javac
If normal, the file will be generated.
(3) Run: Execute at the dos command prompt: (Note the case)
java HelloWorld
Here is a problem that Java beginners are likely to encounter (not afraid of jokes, so do I) which is input:
java
If there are too many .classes in the following, be sure to pay attention, otherwise the following error will occur:
Exception in thread "main" :HelloWorld/class
(I guess whether it was changed to "/" when java translated ".", or other reasons I don't know)
OK, running java HelloWorld should have a great "Hello World".
At this point, you have successfully configured the JDK and can start the Java process of long and painful (for friends like me who didn't understand Java before, you can use "pain" to describe it, concepts that you don't understand, and unfamiliar with Java API..., but don't worry, I will slowly get started with you and slowly improve......).