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?


0
3 comments

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.

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?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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:

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

---
Original message URL: http://devnet.jetbrains.net/message/5448374#5448374



0

Please sign in to leave a comment.