• 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

How to read logging.properties from inside jar file?

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am struggling with java.util.logging: I have a custom ub-logging.properties which works fine when I run the runme.jar from a directory where there's also the ub-logging.properties - using



but I can find no way to make java take it from inside the runme.jar itself

If it was allowed to pack it directly into submission.jar, it could again work after the tester unpacked the submission.jar... But from the instructions I think we are not allowed to put any additional files there...

I'm not sure what to do now - am I overlooking a way to make java read it from inside the jar, or is it just not possible? This would be a pity because I wanted to have a "how to start it with application-specific logging" section in the Guide And of course the standard behaviour of the jdk does not fit too well here...

Thanks a lot for any suggestions!
Sigrid
 
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 Sigrid,

My advice: it's not needed/required and it gives you problems, simply don't do it. You won't get extra credit for doing it.


It is not allowed to define extra parameters when running the runme.jar

Maybe you can try to create a default logging.properties file in the working directory (from within your code, similar way of working with the suncertify.properties file) and use that to initialize your logging properties.

Kind regards,
Roel
 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roel,

thanks for your quick answer! You're right, it makes no sense spending time on something that does not count anyway (I think they say

Your programs must not require use of command line arguments other than the single mode flag,



which for me would mean that it's allowed to use ommand line arguments, as long as the application will run without, too - but anyway)

Unfortunately I just discovered a much bigger problem which will probably keep me from submitting any time soon - would be great if you could have a look at my new post

Thanks again
Sigrid
 
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 Sigrid,

Regarding your remark you are right: if your program runs without the command line arguments you are just fine. I notice that a lot of people have difficulties with just doing what is expected, nothing more, nothing less And most of the time that extra thing gives them some kind of a problem and they have to spend some time on solving the issue although they won't receive any extra credit for it.

I took a look to your other thread and noticed the great Roberto answered this one already, but I'll post my opinion too.

Kind regards,
Roel
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic