This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI " Watch "RMI " New topic
Author

RMI

Rakesh D
Greenhorn

Joined: Oct 09, 2007
Posts: 3
I want to start a java application by double-clicking on the .jar file.But before running the Main-Class -Djava.rmi.server.codebase property has to be set for further applications to work fine

When i run it using command prompt as...
java -Djava.rmri.server.codebase=file:///d:/project/presence/java/build -jar JProgram.jar

it works fine...

can we set the property for directly running the jar file.

Thank you in advance.
Edward Harned
Ranch Hand

Joined: Sep 19, 2005
Posts: 291

java is the application. The application starts the JVM. -D -jar etc are parameters that you pass to the application which in turn is what is used to configure the JVM and invoke your main class.

Double clicking a jar file does none of the above.

You can set properties within the main class, but then the values are hard coded. (java.lang.System.setProperties())


Ed's latest article: A Java Parallel Calamity http://coopsoft.com/ar/Calamity2Article.html
Rakesh D
Greenhorn

Joined: Oct 09, 2007
Posts: 3
Hi Edward
Your solution to the problem worked fine...

Thank you very much.....
Rakesh D
Greenhorn

Joined: Oct 09, 2007
Posts: 3
Edward
The solution works fine.But now i have to hard-code it in main() method.
Is there any other place e.g. manifest file of jar file where we can put the codebase property using relative URL....not the absolute one.

Thank you in advance...
 
GeeCON Prague 2014
 
subject: RMI