从命令提示符编译并运行Eclipse项目 [英] Compile and run Eclipse Project from command prompt
问题描述
如何从命令提示符编译和运行Java Eclipse Project?
How to compile and run Java Eclipse Project from command prompt?
如何从命令行运行Java Eclipse项目,只有java文件名。我不想使用Eclipse生成的类文件或jar文件。
How to run a Java Eclipse project from Command Line with java file name only. I don't want to to use class file or jar files generated by Eclipse.
有可能吗?
即使有jar文件,我发现加载静态文件失败,因为 FileNotFoundException
,如何解决呢?
Even with jar file, I found loading of static file was failing, as FileNotFoundException
, how to solve that?
我打算这样运行 -
I meant to run like this-
http://www.skylit.com/javamethods/faqs/javaindos.html
第一 javac
然后 java
推荐答案
集成开发环境
的整个要点是设置和管理您的源代码及其依赖项。
The whole point of an Integrated Development Environment
is to setup and manage your source code and its dependencies.
Eclipse这样做,Netbeans是另一种方式,IntelliJ也是这样。
Eclipse does this one way, Netbeans does it another way, and so does IntelliJ.
您可以尝试通过模拟Eclipse的部署程序集
来重现它。找出您的库和源代码存储在哪里。将这些目录用于您的 javac
命令。然后,使用包含 main
方法的类执行 java
。
You can try to reproduce it by simulating Eclipse's Deployment Assembly
. Find out where your libraries and source code is stored. Use those directories for your javac
command. Then execute java
with the class you want that contains a main
method.
如果你的项目是一个web应用程序,这变得更难。
This gets harder if your project is meant to be a web application.
你真的应该让IDE为你做。 strong>
You really should let the IDE do it for you.
这篇关于从命令提示符编译并运行Eclipse项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!