而是通过终端中运行蚂蚁是罚款

而是通过终端中运行蚂蚁是罚款

本文介绍了通过Eclipse中运行蚂蚁没有找到环境变量,而是通过终端中运行蚂蚁是罚款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过Eclipse的运行ant一些目标打造精品,但那些需要特定的环境变量,即SOME_SDK,我在我的.profile文件中设置将无法正常工作。即使我尝试回声了$ {} env.JAVA_HOME,蚂蚁通过月食将刚刚打印出的字符串。但是,如果我通过终端(即蚂蚁sometarget)运行ant,它会找到JAVA_HOME和SOME_SDK和回声这些路径了。香港专业教育学院检查日食,它的指向相同的蚂蚁在我的环境路径(/usr/share/java/ant-1.8.1)。任何想法?

When i run ant through Eclipse some targets build fine, but ones that need a specific environment variable i.e. SOME_SDK that i set in my .profile file won't work. Even if i try to echo out ${env.JAVA_HOME}, Ant through eclipse will just print out that string. But if i run ant through the terminal (i.e. ant sometarget), it will find JAVA_HOME and SOME_SDK and echo those paths out. Ive checked eclipse that it's pointing to the same ant that is in my environment path (/usr/share/java/ant-1.8.1). Any ideas?

感谢

推荐答案

当你打开一个终端,在你的.profile文件中的环境变量得到加载。当您通过窗口系统启动Eclipse它不被你的用户帐户下运行,所以你的.profile文件是不是在运行时可用到Eclipse。

When you open a terminal, the environment variables in your .profile get loaded. When you start Eclipse via the windowing system it is not being run under your user account, so your .profile is not available to Eclipse at runtime.

至少这是我的Linux机器上的情况下,我猜测它同样在Mac上。我把Eclipse的需要在/ etc / profile文件,这将会在系统启动时加载看到的环境变量。

At least that's the case on my linux machine and I'm guessing its the same on a Mac. I put the environment variables that Eclipse needs to see in the /etc/profile file, which gets loaded at system startup.

这篇关于通过Eclipse中运行蚂蚁没有找到环境变量,而是通过终端中运行蚂蚁是罚款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 20:46