如何在命令行中运行java项目 [英] How to run a java project in command line
本文介绍了如何在命令行中运行java项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
只需导航到类文件所在的目录,然后使用
java -classpath。 myClass
编辑:您可以用任何类路径替换。例如,要找到您的类路径,您可以使用
echo%CLASSPATH%
编辑:看起来有很多可能有助于您此处的信息。
I have a java project, which runs fine on eclipse. Right now, I need to run it using command line, like java classpath ... How to setup this classpath based on the stored ones using in Eclipse.
解决方案
Simply navigate to the directory that the class file exists in and use
java -classpath . myClass
Edit: You can replace the .
with any classpath. For example, to find your classpath you can use echo %CLASSPATH%
Edit: Looks like there's quite a bit of information that might help you here.
这篇关于如何在命令行中运行java项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文