• 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

Where java.properties file is kept

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't believe that I can't find this on google nor java.sun.com,
but isn't there a java properties file stored somewhere in the jre installation that I can edit to permanently set a system property to a non-default value? I tried $JAVA_HOME/jre/lib/java.properties, but that did not seem to work.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
found in System class:
"private static native Properties initProperties(Properties props);"

It would seem that the System Properties are initialized by a native method. Unless you can access/change that method, I would say that your chances of permanently changing a System Property are pretty slim.
 
Pete Lyons
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't intend to alter system properties like os.name, etc. You know how you can specify you java.policy file to setup your security policy? I thought you could do the same with a properties file so that instead of always doing:
java -DMyCustomSysProperty=myValue
I could just set it once in a file and forget it. Maybe I'm just imagining the whole thing.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make your program do it.
Either keep your own singleton properties object (probably best), or add them to System properties. Something like:
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wait - I just reread your post. What I suggested works if you want to set custom properties, but it will not work for things like security policy that are established as the vm is bootstraped. Sorry for the misdirection.
 
Pete Lyons
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the tips. I'll interpret these suggestions to mean "no". Oh well, I could have sworn there was something just like font.properties, but I guess not.
reply
    Bookmark Topic Watch Topic
  • New Topic