简体   繁体   中英

cannot run java file in command line that created by eclipse

If I create Java file by touch command in command line, edit it using nano, compile it by javac, and then run it, all works well.

But if I use eclipse to build the project, and create file in eclipse. I can compile it using javac, but cannot run it in the command line.

it shows

Error: Could not find or load main class

why this happen? is anything wrong?

sounds like all about right path in which you trying to run your class. did you use packages? did you run it from bin|target|build dir? please provide commands and paths from which you trying to execute it

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