How to run jar file

Hello everyone

I'm learning to user JSSE and trying to develop a simple server-client program using SSL. I notice that if you need to give parameters to java command to run it. For example, if you follow the example code given at

http://tvilda.stilius.net/java/java_ssl.php

then you need to type this to run the program

java -Djavax.net.ssl.keyStore=mySrvKeystore -Djavax.net.ssl.keyStorePassword=123456 EchoServer

I suppose I can make a .bat file to include the above command and start the programs. But I want to distribute my programs in jar files, where one can just double click to run them. Is there anyway to use SSL and still be able to put your class files in a jar file and run it just by double click on it? Is it possible to put those parameters in the manifest file?

Thank you very much for your time! Any help is greatly appreciated!

[893 byte] By [BuggyVBa] at [2007-11-27 9:01:01]
# 1

as far as in know.. you cant put commandline parameters into the manifest.

-Dvariable=value adds an entry into the System.getProperties() map.

so you can easily add a line within your e.g. main():

System.getProperties() .put(variable, value);

thats just an really simple solution.

domEstica at 2007-7-12 21:30:21 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2
Thanks for the quick reply domEstic. I'm going to try it and post any progress back here.
BuggyVBa at 2007-7-12 21:30:21 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 3
Yep, domEstic's method works. All I need to do is to put inSystem.getProperties().put(String var, String value);Thanks again for your help domEstic!
BuggyVBa at 2007-7-12 21:30:21 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...