Java FAQ-javac Hello. java cannot find the file solution, javachello. java

Source: Internet
Author: User

Java FAQ-javac Hello. java cannot find the file solution, javachello. java

Preface

For beginners, there are many difficulties when writing Java code. The following is a common error:

Generally, beginners start learning from Hello and World. After a long time, when they finally want to run javac Hello. java on DOS, they will report an error: the file cannot be found.

Solution

Perform troubleshooting in the following steps:

1. Check whether the environment variables are correctly configured. Output A javac command to output help information, indicating that the configuration information is correct (indicating environment variable configuration, no problem ).

2. If the environment configuration is correct, check whether the path of the java file to be executed is correct.

3. This problem is more likely to occur. .

(In front of me, I am in a hidden state, but I cannot see the. txt and. java files suffixed with the following two files)

My computer is a win10 system. Find the "Hide extensions of known file types" setting method as follows:

This computer --> file --> change folder and search options --> View --> advanced settings --> hide the extension of known files, select the check box to remove

Then you can see whether your suffix is incorrect.

If it is not a win10 system, it should be: My computer --> Tools --> Folder Options --> View -->-hide extensions of known file types. Check the box to remove them.

After the above troubleshooting, my verification is successful and may help you.

Summary

The above is all the content of this article. I hope the content of this article has some reference and learning value for everyone's learning or work. If you have any questions, please leave a message to us, thank you for your support.

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.