Compiling Java file, error: Failed to establish a connection with the target VM

Source: Internet
Author: User

Helloword program, all Java learners the first program in life, Ah Ma, the Foundation is too poor, error

1  Public classhelloword{2 3      PublicHelloword () {4          Public Static voidMain (string[] args) {5System.out.println ("111111111");//enter out and press the TAB key to enter System.out.println6 }7     }8     9     Ten}

1th mistake:

Failed to establish a connection with the target VM

Because the JDK is to be configured in JCreator

Jcreator-configure-option-jdk Profiles-new joins the native JDK

2nd mistake:

Error: The main class could not be found or could not be loaded Helloword

The statement has an error.

The construction method cannot be written in the main method.

Check that there may be some methods that are not java.


The correct one should be:
 Public class Liujuan {            publicstaticvoid  main (string[] args) {            System.out.println ("111111111"); // enter out and press the TAB key to enter System.out.println }            }

Compiling Java file, error: Failed to establish a connection with the target VM

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.