From: brian z. <bz...@zi...> - 2001-04-30 21:02:03
|
Stuart, Looking at the sourcecode, here's why it doesn't work (this method eventually gets called for -D's): public void setProperty(String key, String value) { properties.put(key, value); // This only works for Java 1.2. There appears to be no portable // way to support this under Java 1.1 // try { // System.setProperty(key, value); // } // catch (SecurityException e) {} } Notice it does not set the System property because of the noted comment. You could optionally change the batch/shell script you use to invoke the jython interpreter to pass the -D arguments to the JVM as opposed to the PVM (the way you are doing it) and then the properties will be available to you. Hope this helps... brian At 11:22 AM 4/30/2001 -0700, Stuart Swerdloff wrote: >Hi Folks, > > I have a problem with System Properties not being passed in from >the jython command line in to the jvm (Sun JDK1.3, Win2000) >The Jython command line allows one to set properties for Python to find, >but this >does not >seem to propagate into the JVM. Incorporating the equivalent into the >Jython code >gave me what I needed for my script/program to work, but in a hardcoded >fashion... > >### this works for Jython >System.setProperty("ORBInitRef","EventService=file:C:\IOR\EventServiceForSTUARTS.ior"); > >System.setProperty("SVCnameroot","NameService"); > >which was otherwise done for the JVM as : > >### this works for Java >java -Xint -DSVCnameroot=NameService >-DORBInitRef="EventService=file:C:\IOR\EventServiceForSTUARTS.ior" ... > >### This does not work for getting the data into the JVM from the Jython >command line >jython -DSVCnameroot=NameService >-DORBInitRef="EventService=file:C:\IOR\EventServiceForSTUARTS.ior" ... > >There is something I must not have understood in the documentation for >the use of >properties. > >Could someone provide insight into how to get properties propagated from > >the jython command line in to the JVM (so I can make use of a >System.getProperty(...) >call within my (or other persons) java class. > >Thank You, > >Stuart > > > > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >http://lists.sourceforge.net/lists/listinfo/jython-users |