Message7730

Author bobjalex
Recipients bobjalex
Date 2013-02-22.00:42:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361493776.84.0.808129924396.issue2017@psf.upfronthosting.co.za>
In-reply-to
Content
Using the jython.bat script to run jython results in some user environment variables being modified. Clearly, this is not good  :-)

Of particular note, it changes JAVA_HOME, which can be troublesome since several other programs depend on that variable.

The fix is to put a "setlocal" command as the 2nd line of the script, immediately following the initial "@echo off" line. Or, probably better, just move the existing setlocal line up to that 2nd line position.

Historically, this has been a problem for years with jython.bat. Those who maintain that script should be aware that, unlike Unix, batch scripts do not have their own local copies of the environment. Unless a setlocal has been executed to create a local copy, environment "set" commands affect the calling shell's environment.

Interestingly, a comment in the script says "derived from jruby.bat". But... jruby.bat does not affect its caller's environment, not does jirb.bat. I suspect jython.bat was modeled after a very early jruby.bat  :-)
History
Date User Action Args
2013-02-22 00:42:56bobjalexsetmessageid: <1361493776.84.0.808129924396.issue2017@psf.upfronthosting.co.za>
2013-02-22 00:42:56bobjalexsetrecipients: + bobjalex
2013-02-22 00:42:56bobjalexlinkissue2017 messages
2013-02-22 00:42:56bobjalexcreate