Learning java Article 1: Building a java platform (java se)

Source: Internet
Author: User
Tags java se

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.