Setting and HelloWorld of Java environment variables in 00003_win7

Source: Internet
Author: User

1. Setting of environment variables

(1) Open "Computer" → "System Properties" → "Advanced System Properties" → "Environment variables";

  

(2) NEW:java_home: JDK installation path (e.g.,C:\Tools\Java\jdk1.7.0_51);

  

(3) Path: add %java_home%\bin;;

  

(4) Press the ALT key to display the toolbar, click "Tools" → "Folder Options" → "view" → Remove the "hide extensions of known file types" in front of the check box, so that the file suffix name can be displayed;

  

(5) Windows logo key, hereafter referred to as win key;

  

(6) Press and hold win+r at the same time, input cmd, enter the DOS command line interface;

  

(7) In the DOS interface input java,javac,java-version,javac-veriosn are tested successfully, wherein java-version ,javac-veriosn pop-up interface such as:

  

  

2. Writing Helloworld.java files

(1) Create a new text document and enter the following code

Class helloworld{2     void main (string[] args) {3 System.out.println ("helloworld! I love Java"  ); }5}       

(2) Save to D disk D:\Java\00Base\01day folder, file name is Helloworld.java, save type " All Files ", encoded as ANSI ;

  

(3) switch to the folder where Helloworld.java is saved (for example,D:\Java\00Base\01day);

    d: yes switch to D drive;

cd D:\Java\00Base\01day is the switch to D:\Java\00Base\01day folder;

javac helloworld.java compile helloworld.class file;

Java HelloWorld run the helloworld.class file.

  

(4) Write Java code using advanced Notepad notepad++.

notepad++ download Link: notepad++ Download password: DirY

  

Setting and HelloWorld of Java environment variables in 00003_win7

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.