Eclipse命令行构建

标签 eclipse bash command-line build

我使用下面的 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 时想到的:

  1. 在运行 Eclipse 时,打开终端并运行:

    ps aux | grep eclipse
    
  2. 这将为您提供如下输出:

    /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
    
  3. 这就是确切的过程及其参数。您可以通过将其复制并粘贴到终端并自行运行来对其进行测试。额外的参数存储在 eclipse.ini 中。 有关为脚本配置 eclipse.ini 的更多信息,您可以查看以下内容: What are the best JVM settings for Eclipse?

enter image description here

关于Eclipse命令行构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7835871/

相关文章:

bash - 这些 bash 语句都是等价的吗?

linux - Linux 中的 Bash 脚本初学者

linux - Linux 中追加与连接大文件

java - Axis 故障: "Service class must have public as access Modifier"

eclipse - 为什么我的 Eclipse 项目有虚拟调试器断点?

java - 使用 Eclipse 将调试器附加到应用程序

java - 如何获取 DLL 或 EXE 的文件描述

android - Eclipse AVD Nexus 5 模拟器不工作

linux - 在创建 tar ball 时保留硬链接(hard link)和符号链接(symbolic link)、权限,并在解压缩 tarball 时执行相同操作

c# - 定期检查 C# 中的命令行输出