User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; it-IT; rv:1.8b) Gecko/20050217
Greg Guerin ha scritto:
>>is it possible to set an environment variable at runtime from a Java
>>application? In Java 1.5 java.lang.System class there is the getenv()
>>method, I would only need a setenv() method...
> Why do you need to set the env-var?
> Is it for the Java process itself, or is it for child processes?
> Is the value you set the var to dynamically determined, or is it static?
> If dynamic, what goes into the calculation?
Well, I am actually developing a Java plugin for another Java
application. My plugin uses a native library that search for its
configuration files in a location specified by an environment variable.
The library and che configuration files are inside my plugin folder, my
plugin folder must be placed inside the main Java application folder and
I want that the application folder could reside anywhere on the disk.
So, the env var is for the Java process that runs the main application
and my plugin.
The value could be static determined if I choose to set the environment
variable to a relative path, or dynamically determined setting the
environment variable to an absolute path constructed using the system
property user.dir.
> You can set static env-vars in Info.plist. I think it's the NSEnvironment
> key, but you should probably search ADC.
I'd like to use the dynamic solution because I don't want modify the
main application Info.plist file and I'd like to provide a simple drag
and drop installation/uninstallation.
Anyway, if it's the only solution, I'll go for it.
But then the problem is half solved, because I have to make the plugin
work through Java Web Start, too.
> If the value is dynamic, and can be calculated in a shell script, you can
> create a prelude script that runs first, then executes your normal
> executable. E.g.:
> <http://www.amug.org/~glguerin/howto/More-open-files.html>
>
> The above require a bundled app, and so won't work with command-lines,
> double-clickable jars, nor JNLP.
My plugin must be packed in a jar file.
--
Andrea "XFox" Govoni
ICQ UIN: 43488185
AIM/iChat: email@hidden
Yahoo! ID: xfox82
Skype Name: draykan
PGP
KeyID: 0x212E69C1
Fingerprint: FBE1 CA7D 34BE 4A53 9639 5C36 B7A0 605F 212E 69C1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden