J2SE configuration Problem-;expected Error Summary

Source: Internet
Author: User

The installation of J2SE is very simple, just like installing software, double-clicking and then next until the end. In this process to note that it is important to remember the software installation path, easy to find later.


The first step: Create a new. txt text file in the place you want, and save it as a Helloworld.java file. To write code in a file:

Public Class helloworld{         publicstatic void Main (String [] args) {         System.out.println ("HelloWorld");}}
Note: In this piece of code, be sure to see what each letter is. I then followed the code in the video to write, found a problem, do not know that others found that the println in the L as a capital I (i), the result after I configured a successful path, has been reported an error: ";" Expected. This error is also one of Java's three major errors, very typical of the error, so I met so early, also learned.

Step two: Understand the respective roles of Java and Javac. The Javac+***.java file is compiled, and java+*** is a Java file that runs J-compiled. Use the javac+ file path when compiling, such as:


If you do not configure the path path, you will be prompted that Javac is not an internal or external command error . Then the next step is to configure, to clarify what is written in the path, so do an example comparison:


When this runs, I write the path +helloworld.java file where the Javac is located, and the final compilation succeeds. But if we are going to use it, it is impossible to call Javac every time we have to write the path of Javac, that's too much trouble, so we need to set the path of JAVAC in the environment variable, the role of environment variable is equivalent to when the system calls Javac, The system automatically goes down this path to look for the presence of Javac and then runs.

That's clear. It's easy to configure environment variables: My Computer Right-click--Properties--Advanced settings--System Properties--environment variables--System Variables--path--edit, add the path where Javac is located, this is the path to remember when the previous installation.


this configures path path. But this is just the process of compiling, there is the process of running, this need to configure the classpath path, when the Java files are compiled, you need to run the java+ file path , which also involves the file path, the same, We can't write the path every time we call, so we need to configure CLASSPATH, which adds the path of the compiled class file, and the same:


This is done, run under:


This process says difficult is not particularly difficult, the key is careful, bold attempt. I used most of the time yesterday to configure, configure the video to see countless times, let me understand the principle of configuration is very thorough, and finally in the help of Kun brother Siang, finally I changed to L, painted a full stop.

Beginner Java gave me a dismount, but finally I came over, and through this process, I experienced the various stages of irritability, anxiety, sulking, but also to their own a exercise bar, mentality is right, there is no way out of the hurdle.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

J2SE configuration Problem-;expected Error Summary

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.