I'm using xuggler api in my applet. And xuggler's wiki says I cannot use it in an applet. But I tried it with 3 computers. And my applet will work if I can add xugglers bin folder to system environment path variable and create a new environment variable XUGGLE_HOME
. I have no problem with copying xugglers libraries to target computer. What I would like to do is something like that:
- Copy xuggler files
- Set environment variables
- Run applet
- Delete xuggler files
- Delete environment variables
But probably because I'm doing these in applet, environment variable changes won't be effective in that applets runtime. And another problem is how I could change environment variables. Because if I use a .bat file, it has a limit that would make malformations in path variable. And other choices like vbscript and .reg file didn't work.(vbscript gives access denied on some computers and .reg file looks like it works but doesn't work somehow)
So is there anyway to set environment variables prior to running applet?
Thanks
EDIT : Actually I tried a different method now which worked like a charm. Now my applet on website only copies xuggle folders and my main program jar into a temp directory from a zip file. Then applet launches a bat file which was in zip file. Bat file sets (not setx) variables and runs my main jar. Because child process gets parents environment it works. And after that cmd window closed, no change to system. Only if I could hide that cmd window.
Well,that said I still wonder if it's possible to change environment variables in java.
You could set params for use in your applet if only the applet needs the
XUGGLE_HOME
path.