• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executing from jar file

 
Dmitri Christo
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have ran into a new doubt after packaging and testing my jar file. The instructions say to package the given db file into the jar. Does this imply that my application should be able to use that db file from within the jar?

I am asking since I am testing my jar file in a new directory separated from my IDE environment and on different machines. When I start with the -alone command line argument, the starter gui comes up asking where to find the db file. If I am testing the jar in a different machine (in standalone mode), is there a way (through the gui) to point to the db file that is included in the jar itself? I am not sure how to do this and suspect I might have omit something important..

Many thanks for your suggestions
 
fei lin
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
packaging everything is just used to submit, Sun will unpackag it leaving you runme.jar, xxx.db, docs/* etc... then run it.
 
Dmitri Christo
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. This sounds reasonable, but is that for certain? I was having doubts because the statement in the instructions is:
The mode flag must be either "server", indicating the server program must run, "alone", indicating standalone mode, or left out entirely, in which case the network client and gui must run.

I was under the impression that the executable jar should be able to handle all modes right from the command line... Of course if the jar is not unpacked, then the examiner would have to have a copy my original db file, then run the jar and point to the new db location (outside the jar).. Is that too speculative or is this how assignments are usually tested?

But I think you are right, if all the examiner has is my jar file and nothing else, some sort of preparation will be needed to run all different modes. I assume that would be find a copy of the db file somewhere else, or unpack the jar... Hope this reasoning is close to the real thing. Thanks for any other suggestions
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like Fei said, the "outer" jar is only used for packaging purpose..

Consider the requirement in the "packaging section":


Packaging of Submissions
All elements of your submission must be packaged in a single JAR file. The JAR file must have the following layout and contents in its root:
- The executable JAR containing the programs. This must be called runme.jar.
- ...


The "outer JAR file" will contain your application (runme.jar) and many other files.. runme.jar is your real application, while the outer jar is a simple archive..
SUN will need to extract the outer jar before they can use your application.

Regards,
Alex
[ March 12, 2008: Message edited by: Alex Belisle Turcot ]
 
Dmitri Christo
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex, you are right! thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic