Computer System: Windows 8
Here we will introduce three versions of the java platform:
Java SE -- Java Standard Edition, Java Standard Edition, is mainly used for table-level application and database development.
Java EE-Java Enterprise Edition, Java Enterprise Edition, provides a variety of Enterprise-level development technologies, mainly used for Enterprise-level development.
Java ME-Java Micro Edition is mainly used for developing mobile and mobile apps.
Here we use java se
Step 1: download Java SE: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html? SsSourceSiteId = otncn
Step 2: configure the environment variable (PATH, CLASSPATH, JAVA_HOME) after installation)
My computer → properties → advanced system settings → advanced → Environment Variables
Modify PATH (add C: \ Program Files \ Java \ jdk1.8.0 _ 05 \ bin at the end; C: \ Program Files \ Java \ jdk1.8.0 _ 05 \ jre \ bin; depends on your installation path ),
Added CLASSPATH: C: \ Program Files \ Java \ jdk1.8.0 _ 05 \ lib; C: \ Program Files \ Java \ jdk1.8.0 _ 05 \ lib \ tools. jar;
Added JAVA_HOME: C: \ Program Files \ Java \ jdk1.8.0 _ 05
Article 3: After the configuration is complete, go to the test and open cmd.exe. Enter the java prompt.
The following prompt appears when you enter javac.
It proves that the java platform has been configured. You can also enter java-version and javac-version to view the version information.
After the platform is set up, write a Hello World
Change the name of a new text file to HelloWorld. java.
Write the following code:
1 public class HelloWorld2 {3 public static void main (String [] args) 4 {5 System. out. println ("Hello World! "); 6} 7}HelleWorld
Note that the class name must be the same as the file name.
Then compile it because my HelloWorld. java is on disk D. Open cmd.exe and enter javac HelloWorld. java.
After the compilation is successful, a HelloWorld. class will appear on drive D, and then enter the java HelloWorld command to run the file.
If the following error message appears:
There are two possible reasons: First, the name is incorrect; second, the CLASSPATH environment variable configuration is incorrect. You must add ";"
After the modification, close the command window, open it again, and enter the command.
OK. Now, you can start my java journey.