I am getting some requests from NT users on an application that I wrote on 
a Java/Linux environment. I have a Java application that runs fine on Unix 
and I am trying to get to run perfectly on NT. I have a run time shell 
script that passes the entire environment to the JVM using a system 
property.

        java -Denv=`env` xenon.xsql.editor.Xsql

The env produces the multiline environment variables list that we know and 
love. On running the application the program looks for the value of system 
property called `env'. Hence the JVM gets the entire environment. I have 
source code that breaks down the multiline value and cuts out each variable 
definition like `HOME=/home/peterp'. The definition is further split into a 
name and value (`HOME' and `/home/peterp') and then place stored in the 
system properties as renamed property `env.HOME' and `/home/peterp'. In 
short all the environment variable are prepended with `env.'. Using this 
hand-me-down old deprecated source code from an unknown URL, I can write 
code like this:

        String imagesDir=System.getProperty("env.IMAGES_DIR");
        String searchPath=System.getProperty("env.JAVAFILESEARCHPATH");
        

Of course this does not work with Windows NT (or 95/98). I am not an expert 
on NT. I do not think there is an equivalent for `env' under NT.
Is there such thing ?

Of course I could write a work around that involve just passing a limited
number of properties to JVM in a NT batch command `.BAT' file.

        java -DIMAGES_DIR=%IMAGES_DIR%  ...  xenon.sql.editor.Xsql

Admittedly the full final code would look terrible ugly. I am clueless if 
the DOS? W95/NT Shell allows long character lines. Can you even do `back 
subtitution' using the W95/NT shell is also quite another thing as well? 
Also when I tried extending my `PATH' under W95 I got `out of environment 
space' or something?

However do any other java-linuxers know of a better solution or API?

Any help receives my grateful kudos.

Pete

Reply via email to