Yes, but you can't specify the file on the command line.  Well, you sort of can, but in a minute.

First, you could do this somewhere in the bowels of your application, in one of your base classes: props = loader.getResourceAsStream("myProperties.txt");

But that's fraught with peril, as you may overlay system properties.

And in fact, once you've gotten to the point where you have a base class that you can modify, you could just write your own small routine to parse an .ini file and do the system.setProperty.

I'm guessing, though, that you want to just be able to specify a properties file on the command line and have the JVM parse it for you.  And that, sadly, is not an option AFAIK.

On 3/14/2019 3:24 PM, David Gibbs via JAVA400-L wrote:

Does anyone know if there is a way to invoke Java code (on the i or not) so that system properties are loaded from a property file instead of the command line?

What I want to do is avoid using -Dproperty=value or PROP((property value)) and just specify a property file that all those system properties would be specified in.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.