Are there some methods to set the system variable on Windows and UNIX? I think it must be done by Runtime.exec(cmd). And my question is what's the cmd?
If by "system variable" you mean "environment variable" the answer is that you can't, at least not portably. On UNIX you might conspire to edit the user's .profile or .cshrc or .bashrc or .tcshrc file (each of which can use a different syntax!) On Windows, you'd need a small auxilliary program or bit of native code to put the values into the registry. And then, of course, you're forgetting Macs. Can I ask why you want to do this?
Post by:autobot
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
a bit of art, as a gift, that will fit in a stocking