JagWire
JagWire

Reputation: 269

Where on a Mac are Java system properties stored?

I've inherited some code which makes extensive use of setting java system properties. I'm curious where in the file system this is stored and if there is a way to read it in plain text. I'm using Mac OS X Snow Leopard and I've found some idx files that look to be binary, but I'm not terribly familiar with the internals of Java's system properties. Is there a specific place the JVM stores a file containing its system properties?

EDIT: I was mistaken, I apologize. The code is is using preferences, not properties. On Mac OS X Snow Leopard [at least], these preferences are stored in ~/Library/Preferences.

Upvotes: 0

Views: 8575

Answers (2)

Stephen C
Stephen C

Reputation: 719739

In answer to your original question, the Java system properties are not stored anywhere. Instead, they are assembled when the JVM is launched based on things such as the user's name and home directory, the current directory and the locale, and "hard-wired" information about the JVM itself. This is augmented with property name/value pairs specified by -D<prop>=<value> command line options.

Upvotes: 3

Guillaume Polet
Guillaume Polet

Reputation: 47637

The implementation of Java Preferences is platform dependent. On Linux, it is stored in the user home directory. On Windows, it is stored in the Registry. You should use the Java API to access them. And I am not even sure that different JVM cannot choose different implementation on the same platform.

Upvotes: 0

Related Questions