从命令提示符编译并运行Eclipse Project [英] Compile and run Eclipse Project from command prompt

查看:242
本文介绍了从命令提示符编译并运行Eclipse Project的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从命令提示符编译和运行Java Eclipse Project?

How to compile and run Java Eclipse Project from command prompt?

如何使用Java文件名从Command Line运行Java Eclipse项目。我不想使用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 then 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 命令。然后执行 java 与你想要的类包含一个 main 方法。

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 Project的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆