• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar location question

 
Siebe Krijgsman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear salooners, I have a question regarding the location of the jar file and the path. The SCJD requirements state:

When you submit your assignment, each part (client and server) must be executable using a command of this exact form:

java -jar <path_and_filename> [<mode>]


However, if i run my runme.jar from a different directory, for example like this:

c:\user> java -jar SCJD\runme.jar

it will set my current dir (System.getProperty("user.dir")) to c:\user\ instead of the desired c:\user\SCJD\. My project relies on this path but since the specification allows this form, I'm at a loss on how to locate the root directory of my project (in this case c:\user\SCJD\)
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siebe,

Welcome to the JavaRanch! Sounds like you are from Belgium or the Netherlands.

My suncertify.properties file is always (so it does not depend on the location of the runme.jar) created in the current working directory (retrieved with System.getProperty("user.dir")).

Kind regards,
Roel
 
Siebe Krijgsman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I realise this. But my application is currently using a html file for a help file, and its path is relative to that of runme.jar (according to the specs). Is there a better way to load these?
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siebe,

I would expect your html help files to be packaged in the runme.jar and accessed through methods like getResourceAsStream(), like shown in this thread.
Or if you encounter to much trouble, you can just go for a external html user guide (or even a plain text version). There is no must requirement to include the help into your application.

Kind regards,
Roel
 
Siebe Krijgsman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies Roel. I decided to just leave the helpfile inside the program, but give an error message when it can't be loaded and redirect the reader directly to the location.
Since it's not a must requirement: Problem solved
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic