idea 编译的java文件 外面直接运行
天蓬老师
天蓬老师 2017-04-18 10:55:21
0
2
745

比如写个了helloworld,在idea内部build了,然后cd切换到class文件所在目录,直接java运行,报错找不到主类

这种一般怎么解决的?

java文件有“com.xx.xx”这种package声明

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
Ty80

Look at the name of your com.xx.xx, create xx in the folder com in the current path, create xx in xx, copy the class file into it, and then return to the current path java com.xx.xx. Just name it and it’s ready to run

黄舟

1.idea has been compiled, similar to
2. Switch the directory to the upper-level folder of the top-level directory of your package (my top-level is cn, to the upper-level directory of cn, I am E:workspacejavapackageDemooutproductionpackageDemo), add this directory to CLASSPATHE:workspacejavapackageDemooutproductionpackageDemo),将这个目录添加到CLASSPATH

3.在目录下打开cmd
4.执行java [package].className
3. Open cmd in the directory 4. Execute java [package].className

🎜🎜🎜🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template