<bdo id='MW89P'></bdo><ul id='MW89P'></ul>

<legend id='MW89P'><style id='MW89P'><dir id='MW89P'><q id='MW89P'></q></dir></style></legend><tfoot id='MW89P'></tfoot>
    1. <i id='MW89P'><tr id='MW89P'><dt id='MW89P'><q id='MW89P'><span id='MW89P'><b id='MW89P'><form id='MW89P'><ins id='MW89P'></ins><ul id='MW89P'></ul><sub id='MW89P'></sub></form><legend id='MW89P'></legend><bdo id='MW89P'><pre id='MW89P'><center id='MW89P'></center></pre></bdo></b><th id='MW89P'></th></span></q></dt></tr></i><div id='MW89P'><tfoot id='MW89P'></tfoot><dl id='MW89P'><fieldset id='MW89P'></fieldset></dl></div>

      <small id='MW89P'></small><noframes id='MW89P'>

      1. 设置环境变量启动 mac eclipse

        Launch mac eclipse with environment variables set(设置环境变量启动 mac eclipse)
          <bdo id='OU4Lc'></bdo><ul id='OU4Lc'></ul>

              1. <tfoot id='OU4Lc'></tfoot>

                  <small id='OU4Lc'></small><noframes id='OU4Lc'>

                    <tbody id='OU4Lc'></tbody>

                  <legend id='OU4Lc'><style id='OU4Lc'><dir id='OU4Lc'><q id='OU4Lc'></q></dir></style></legend>

                • <i id='OU4Lc'><tr id='OU4Lc'><dt id='OU4Lc'><q id='OU4Lc'><span id='OU4Lc'><b id='OU4Lc'><form id='OU4Lc'><ins id='OU4Lc'></ins><ul id='OU4Lc'></ul><sub id='OU4Lc'></sub></form><legend id='OU4Lc'></legend><bdo id='OU4Lc'><pre id='OU4Lc'><center id='OU4Lc'></center></pre></bdo></b><th id='OU4Lc'></th></span></q></dt></tr></i><div id='OU4Lc'><tfoot id='OU4Lc'></tfoot><dl id='OU4Lc'><fieldset id='OU4Lc'></fieldset></dl></div>
                  本文介绍了设置环境变量启动 mac eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我公司提供了一个基于eclipse的开发环境,需要为底层工具链设置一些环境变量,这样可以同时安装多个版本,而不是接管系统.

                  My company provides an eclipse based development environment which needs some environment variables setting up for the underlying toolchain so multiple versions can be installed concurrently and not take over the system.

                  我想在 finder 或 Dock 中提供一个图标来设置这些图标,然后启动 eclipse,这样客户就不会在没有设置环境的情况下意外启动 eclipse.这是我迄今为止尝试过的:

                  I want to provide an icon in finder or the dock which sets these then launches eclipse so customers cannot accidentally launch eclipse without the environment being set. This is what I have tried so far:

                  1. Info.plist 中的设置环境日食:

                  1. Setting environment in Info.plist for eclipse:

                  这应该是一个不错的方法但我不能让它添加到现有路径(如导出PATH=/myapp/bin:$PATH).

                  This should be a nice way to do it but I cannot make it add to the existing path (like export PATH=/myapp/bin:$PATH).

                  包装eclipse的bash脚本:

                  bash script wrapping eclipse:

                  我创建了一个名为eclipse.command 设置环境然后启动eclipse.这也会打开一个终端窗口作为日食图标并允许人们为了保持码头"光秃秃的日食.我不能放坞站上的 eclipse.command 原样不是应用程序.

                  I created a bash script called eclipse.command to set the environment then launch eclipse. This opens a terminal window as well as the eclipse icon and allows people to "Keep on dock" for the bare eclipse. I cannot put eclipse.command on the dock as it is not an application.

                  Applescript 包装 eclipse.command:

                  Applescript wrapping eclipse.command:

                  Applescript 包装器eclipse.command 使它看起来像一个应用程序并阻止终端窗口出现.不幸的是,我现在得到一个停靠图标applescript 和一个用于 eclipse 所以仍然可以保持裸露的日食码头.

                  An Applescript wrapper around eclipse.command makes it look like an app and prevents the terminal window appearing. Unfortunately I now get a dock icon for the applescript and one for eclipse so can still keep the bare eclipse on the dock.

                  有什么建议吗?我是否以完全错误的方式处理这个问题?

                  Any suggestions? Am I going about this in completely the wrong way?

                  推荐答案

                  当用户启动 Eclipse 应用程序时,有一个替代的解决方案是用一个设置环境的 shell 包装器替换 MacOS X 运行的可执行文件.

                  There is an alternate solution which involves replacing the executable that is run by MacOS X when the user launches the Eclipse application with a shell wrapper that sets up the environment.

                  在 Eclipse 应用程序包目录/Applications/eclipse/Eclipse.app/Contents/MacOS 中创建一个名为eclipse.sh"的空文本文件.

                  Create an empty text file called "eclipse.sh" in the Eclipse application bundle directory /Applications/eclipse/Eclipse.app/Contents/MacOS.

                  在文本编辑器中打开 eclipse.sh 并输入以下内容:

                  Open the eclipse.sh in a text editor an enter the following contents:

                  #!/bin/sh
                  
                  export ENV_VAR1=value
                  export ENV_VAR2=value
                  
                  logger "`dirname "$0"`/eclipse"
                  
                  exec "`dirname "$0"`/eclipse" $@
                  

                  在示例中 ENV_VAR1 和 ENV_VAR2 是正在设置的环境变量.这些变量将对从 Eclipse 中启动的进程可见.logger 命令只会将 eclipse 可执行文件的路径记录到 system.log 作为调试帮助.

                  In the example ENV_VAR1 and ENV_VAR2 are the environment variables being set up. These variables will be visible to processes launched from within Eclipse. The logger command will just log the path of the eclipse executable to the system.log as a debugging aid.

                  在终端中设置shell脚本eclipse.sh的可执行标志,即:

                  In the Terminal set the executable flag of the shell script eclipse.sh, i.e.:

                  chmod +x /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.sh
                  

                  打开 Eclipse.app Info.plist 并将键 CFBundleExecutable 的值从 eclipse 更改为 eclipse.sh.

                  Open the Eclipse.app Info.plist and change the value for the key CFBundleExecutable from eclipse to eclipse.sh.

                  MacOS X 不会自动检测 Eclipse.app 的 Info.plist 已更改.因此,您需要使用 lsregister 命令强制更新终端中的 LaunchService 数据库:

                  MacOS X does not automatically detect that the Eclipse.app's Info.plist has changed. Therefore you need to force update the LaunchService database in the Terminal by using the lsregister command:

                  /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/Eclipse.app
                  

                  下次从 Dock 或 Finder 启动 Eclipse.app 时,应设置环境变量.

                  The next time you launch Eclipse.app from the Dock or from the Finder the environment variables should be set.

                  这篇关于设置环境变量启动 mac eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Java System Environment Variable(Java 系统环境变量)
                  Tomcat 8 - context.xml use Environment Variable in Datasource(Tomcat 8 - context.xml 在数据源中使用环境变量)
                  Issue with JAVA_HOME(JAVA_HOME 的问题)
                  Access shell environment variables in Java(在 Java 中访问 shell 环境变量)
                  set windows PATH environment variable at runtime in Java(在 Java 运行时设置 windows PATH 环境变量)
                  Tomcat: How do I set up a Java system property in Netbeans?(Tomcat:如何在 Netbeans 中设置 Java 系统属性?)

                  • <bdo id='EUbba'></bdo><ul id='EUbba'></ul>
                  • <tfoot id='EUbba'></tfoot>

                          <tbody id='EUbba'></tbody>
                        <legend id='EUbba'><style id='EUbba'><dir id='EUbba'><q id='EUbba'></q></dir></style></legend>
                        • <i id='EUbba'><tr id='EUbba'><dt id='EUbba'><q id='EUbba'><span id='EUbba'><b id='EUbba'><form id='EUbba'><ins id='EUbba'></ins><ul id='EUbba'></ul><sub id='EUbba'></sub></form><legend id='EUbba'></legend><bdo id='EUbba'><pre id='EUbba'><center id='EUbba'></center></pre></bdo></b><th id='EUbba'></th></span></q></dt></tr></i><div id='EUbba'><tfoot id='EUbba'></tfoot><dl id='EUbba'><fieldset id='EUbba'></fieldset></dl></div>

                            <small id='EUbba'></small><noframes id='EUbba'>