[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

What is my non-programmatic alternative to setting System properties instead of using -D to set them?

I know that you can specify system properties to be used by Java by specifying -Dmy.property.name=myvalue in the command-line, but is there a way to specify a .properties file to read these properties in from VIA THE COMMANDLINE without altering my code?

What I'm trying to do:
I'm trying to install various instances of Tomcat, but I want to be able to specify in separate .properties file some of the variables to be set in the server.xml.  I've been successful in doing this with -D, i.e. -Dtomcat.http.port=8082 and then in my server.xml replacing the port # with ${tomcat.http.port}.  This would seem to be more maintainable if I could just keep a digest of all of the properties in one file that I could point to instead of altering my startup scripts.
0
TomBruser
Asked:
TomBruser
  • 4
  • 2
1 Solution
 
CEHJCommented:
What OS do you run on?
0
 
CEHJCommented:
Starting with Ant is a good way, whatever OS you use
0
 
TomBruserAuthor Commented:
It may be either Windows or AIX depending on if it's development, testing, QA, etc.  What would be the ant approach?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
CEHJCommented:
See

http://ant.apache.org/manual/CoreTasks/java.html

look at the examples with jvmarg elements - that's what you need
0
 
CEHJCommented:
:-)
0
 
objectsCommented:
Starting with ant's going to be a maintenance nightmare, trust me :)
0
 
TomBruserAuthor Commented:
Sorry that points have already been awarded since it is technically a valid solution that CEHJ provided, but what would you suggest as an alternative?  I'm not a big ant fan either - but I use it when necessary.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now