我使用下面的 bash 脚本从命令行构建 Eclipse 工作区。不过,我还没有想出如何在工作区内构建特定项目...我该怎么做?
#!/bin/sh
echo Eclipse path: ${ECLIPSE}
echo Eclipse workspace path: ${ECLIPSE_WORKSPACE}
stdout=$("${ECLIPSE}/eclipsec" -nosplash -application org.eclipse.jdt.apt.core.aptBuild -data "${ECLIPSE_WORKSPACE}" 2>/dev/null)
echo ${stdout}
if [[ ${stdout} == *error* ]]
then
exit 1
fi
exit 0
最佳答案
你问这个问题已经很久了,但我在 StackOverflow 的“未回答”部分看到了它。
我看到你在 Linux 中制作了一个 Bash 脚本,这是我有一天在配置我的 eclipse.ini 时想到的:
在运行 Eclipse 时,打开终端并运行:
ps aux | grep eclipse
这将为您提供如下输出:
/usr/bin/java -XX:MaxPermSize=256m -jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar -os linux -ws gtk -arch x86_64 -showsplash -launcher /usr/lib/eclipse/eclipse -name Eclipse --launcher.library /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.dist/eclipse_1407.so -startup /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar --launcher.overrideVmargs ... and so on
这就是确切的过程及其参数。您可以通过将其复制并粘贴到终端并自行运行来对其进行测试。额外的参数存储在 eclipse.ini 中。 有关为脚本配置 eclipse.ini 的更多信息,您可以查看以下内容: What are the best JVM settings for Eclipse?
关于Eclipse命令行构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7835871/