如何在Eclipse中构建Java项目,以创建外部JAR [英] How do I build a Java project in Eclipse, to create an external JAR

查看:104
本文介绍了如何在Eclipse中构建Java项目,以创建外部JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近继承了一个用Java编写的大型软件项目。最后一个开发人员使用Eclipse,所以这就是我正在使用的,但是我不知道如何构建任何东西。我看不到任何构建脚本,当我在Eclipse中打开项目时,构建所有和构建项目选项都是灰色的。



项目是本质上是一大堆依赖于彼此的包。我知道这必须是一个简单的问题,但是我无法通过Google搜索找到答案,或者只是在Eclipse上找到答案。我对这个IDE很新 - 我的大部分职业生涯都是与Visual Studio合作的。任何问题/建议将非常感谢。

解决方案

文件 - >导出 - >导出JAR文件。然后选择你的项目,按下两次,选择主类。















如果您只需要运行,打开主类并点击顶部的绿色箭头。





如果您只想构建类文件,我相信Eclipse每次保存时都会自动构建。您需要选择项目 - >自动构建




I recently inherited a large software project written in Java. The last developer used Eclipse, so that's what I'm using, but I can't figure out how to build anything. I don't see any build scripts, and when I open the project in Eclipse the "Build All" and "Build Project" options are greyed out.

The project is essentially a huge collection of packages that depend on one another. I know this has to be a simple question but I haven't been able to find an answer through Googling or through just poking around on Eclipse. I'm very new to this IDE - I have worked with Visual Studio for most of my career. Any questions/suggestions would be very much appreciated.

解决方案

File -> Export -> Export JAR File. Then select your project, press next twice, select the main class.

If you just want to run, open the main class and click the green arrow at the top.

If you just want to build class files, I believe that Eclipse automatically builds every time you save. You need to select Project -> Build Automatically

这篇关于如何在Eclipse中构建Java项目,以创建外部JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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