Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can RMI download jar instead of classes  RSS feed

 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am going through Sun's RMI tutorial, when it comes to deployment, it says to extract the jar file and put the classes in a network accessiable directory. I am just curious to know whether I can put the jar file in my directory and expect everything works.

My guess is that it does not since the tutorial specifically said to extract classes out of the jar file. I am just wondering why Sun could not go a step further, since they allow jar in CLASSPATH, why not allow jar files in RMI download, that would save us from extracting all classes and then copying it over.

Thanks.
Yan
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't put the JAR file in the network accessible directory (called the "codebase")... you have to *make* the JAR file the codebase (i.e. point at the JAR file itself instead of the directory it is in). You can look at the bottom example in section 5.0 of the Dynamic code downloading using RMI tutorial for how this would look.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!