Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Mac Environment Variables and Java (http://www.mac-forums.com/forums/os-x-development-darwin/209585-mac-environment-variables-java.html)

malakh 07-27-2010 01:54 PM

Mac Environment Variables and Java
 
Hey guys -

I am trying to access an environment variable that i created with Java (System.getProperty()), but it is always coming back as not existing. I have tried adding it to the .profile:

Code:

export CAPTUREDBHOST=localhost
And that doesn't work. I have also tried adding it to the ~/.MacOS/environment.plist:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CAPTUREDBHOST</key>
        <string>localhost</string>
</dict>
</plist>

And that isn't working either. What am I missing?

malakh 07-27-2010 06:05 PM

Figured it out. I was using the wrong method in Java. Should of been using System.getenv(), not System.getProperty()


All times are GMT -4. The time now is 01:29 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.