简体   繁体   中英

Java compilation through command prompt issue

我的错误尝试与我对 checker 所做的相同 I tried to compile my class file "checker.class" into "checker.java" through the use of the javac command, planning to run it with the java command, but javac either gave me the issue of "file not found" OR "invalid flag" (when I tried to put checker in quotations.) I would also like to understand the issue itself better and not just know the solution. Thanks.

What I attempted:

C:\Users\jaede\Desktop\everything>javac checker.class

C:\Users\jaede\Desktop\everything>javac "checker.class"

Results with error messages:

  1. error: file not found: Checker.java Usage: javac use --help for a list of possible options

    1. error: invalid flag: Checker.class Usage: javac

    use --help for a list of possible options

planned to do:

C:\Users\jaede\Desktop\everything>java checker.java

*Sidenote: I probably do not have an environment variable issue, since I could run this with another.java files with the java command 我预建的斐波那契数生成器。

I got.class and.java mixed up. The comments to the original post have the full rundown.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM