从命令行构建Eclipse Java项目 [英] Build Eclipse Java Project from Command Line

查看:211
本文介绍了从命令行构建Eclipse Java项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从命令行编译基于Eclipse的Java项目?

Is there a way to compile an Eclipse-based Java project from the command line?

我试图自动化我的构建(使用FinalBuilder而不是ant),我既不是Java也不是Eclipse专家。我可能想出了如何做到这一点与直接的java命令行选项,但然后Eclipse项目感觉像很多浪费的努力。

I'm trying to automate my build (using FinalBuilder not ant), and I'm neither a Java nor Eclipse expert. I can probably figure out how to do this with straight java command line options, but then the Eclipse project feels like a lot of wasted effort.

如果没有通过命令行编译Eclipse项目的方法,有没有办法从Eclipse中生成所需的java命令行?还是有一些文件,我可以找到找到它在幕后做的编译步骤?

In the event that there is no way to compile an Eclipse project via the command line, is there a way to generate the required java command line from within Eclipse? Or are there some files I can poke around to find the compile steps it is doing behind the scenes?

伙计,我在寻找一个能够让我重复一遍原来的问题.......有没有办法从命令行构建一个Eclipse项目?

Guys, I'm looking for an answer that does NOT include ant. Let me re-iterate the original question ....... Is there a way to build an Eclipse project from the command line?

我不认为这个是一个不合理的问题,因为我可以做这样的视觉工作室:

I don't think this is an unreasonable question given that I can do something like this for visual studio:

devenv.exe /build "Debug|Any CPU" "C:\Projects\MyProject\source\MyProject.sln"


推荐答案

您可以通过命令行通过工作区构建一个eclipse项目:

You can build an eclipse project via a workspace from the command line:

eclipsec.exe -noSplash -data "D:\Source\MyProject\workspace" -application org.eclipse.jdt.apt.core.aptBuild

它使用 jdt apt 插件自动构建工作区。这也被称为无头建造。很难弄清楚。如果你不使用win32 exe,你可以尝试:

It uses the jdt apt plugin to build your workspace automatically. This is also known as a 'Headless Build'. Damn hard to figure out. If you're not using a win32 exe, you can try this:

java -cp startup.jar -noSplash -data "D:\Source\MyProject\workspace" -application org.eclipse.jdt.apt.core.aptBuild

这篇关于从命令行构建Eclipse Java项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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