Pb with System.getenv() on OS X with Maven
Hi,
lauching a Maven jetty:run goal from within IDEA, I don't seem to be
able to read a System variable with System.getenv(var_name).
It works nicely when i run jetty:run from the command line.
I'm under OS X 10.7.2
Any idea how I could be able to get this System.getenv(…) be able to
work when running Maven config from IDEA?
请先登录再写评论。
Hello nodje,
Where is the environment variable defined? If you define it in .bash_profile,
it won't be visible to the IntelliJ IDEA process or the processes launched
from it.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
OS X GUI apps don't inherit the shell environment. If you're on 10.6 or later, you can set environment variables using the ~/.MacOSX/environment.plist file.
- http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html
- http://developer.apple.com/library/mac/#qa/qa1067/_index.html
Thanks, I forgot that point.
Somehow I thougt maven process launched from IDEA would inherit command
line environment variables.
That being said, I can't get it to work. Variable I put in the
.MacOSX/environment.plist aren't available in the app context with
System.getenv().
There are a lot of variable available though, and I'm wondering where
they are read from.
On 2012-01-09 18:34:33 +0000, Charles Wise <no_reply@jetbrains.com> said:
-