A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/326458.html below:

Windows paths, Java, and command-line arguments, oh my!

Windows paths, Java, and command-line arguments, oh my!Daniel Dittmar daniel at dittmar.net
Mon Sep 19 18:18:28 EDT 2005
Steve M wrote:
> I'm trying to invoke a Java command-line program from my Python program
> on Windows XP. I cannot get the paths in one of the arguments to work
> right.
> 
> The instructions for the program describe the following for the
> command-line arguments:
> 
> java -jar sforcedataloader.jar -Dsalesforce.config.dir=CONFIG_DIRECTORY
> 
> They also give an example:
> 
> java -Dsalesforce.config.dir=c:\config -jar sforcedataloader.jar
> 
> If I type the example above at the cmd.exe command line the thing works
> (assuming I have the config file in c:\config). What doesn't work is
> these two lines:
> 
> cmd = r'java -jar sforcedataloader.jar -Dc:\config'
> os.system(cmd)

If you write
java -jar x.jar -Dwhatever=x
then -Dwhatever=x is passed as an argument to the main method of the 
main class in x.jar.

If you write
java -Dwhatever=x -jar x.jar
then -Dwhatever=x is interpreted by java and put into the system properties.

Daniel

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4