Meaningless Drivel is fun!
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


Rakesh D

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 Reactive Generator
Rakesh D

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

Thank you very much.....
Rakesh D

Joined: Oct 09, 2007
Posts: 3
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...
I agree. Here's the link:
subject: RMI
It's not a secret anymore!