Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI

 
Rakesh D
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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())
 
Rakesh D
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Edward
Your solution to the problem worked fine...

Thank you very much.....
 
Rakesh D
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic