• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jar location question

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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\)
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic