Forums > Java

setting environment variables in MAX

May 28, 2008 | 8:46 pm


I have a jar file, which runs fine in a shell, that I want to use in MAX. Running the jar from an MXJ object, certain environment variables are not properly set. Is there a way for MAX to set these? I was thinking maybe there is a max.jvm.option you could put in the that will set the desired values. Other possibilities are welcome.


May 30, 2008 | 5:30 pm

I believe environment variables are read-only in Java. They have to be set in the environment before you run a Java process. I’m not aware of a way to do this in Max.

If your Java program is running another process, then I think you can change them for that process. But not for the current process. More info at

Usually the standard way to pass environment variable-like settings to Java is to use system properties. These are changeable inside Java, and could also be set with the -Dname=value option in the file.

So are you sure you really need environment variables, or would system properties work?

If it has to be environment variables, and you are on OS X, I maybe you could use the environment.plist file?

Viewing 2 posts - 1 through 2 (of 2 total)

Forums > Java