Mac Environment Variables and Java

Joined
Oct 3, 2009
Messages
4
Reaction score
0
Points
1
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?
 
OP
M
Joined
Oct 3, 2009
Messages
4
Reaction score
0
Points
1
Figured it out. I was using the wrong method in Java. Should of been using System.getenv(), not System.getProperty()
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top