Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8550375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:56:10+00:00 2026-06-11T13:56:10+00:00

this may be a stupid question: I currently have some VM arguments that my

  • 0

this may be a stupid question:

I currently have some VM arguments that my web application requires. They are something like:

-Dcom.company.custom.var='test'

And I access them in code with:

System.getProperty("com.company.custom.config")

I would like to move them into one of the tomcat xml files (server.xml, context.xml, etc) but I’m not sure how I would go about doing that.

So my question is two parts. Where (and how) should I put these variables into xml and how do I access them in code?

Thanks in advance and sorry if this has already been answered. My search-fu on this topic has failed me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:56:12+00:00Added an answer on June 11, 2026 at 1:56 pm

    Officially, all JVM options go either to setenv.sh (for Unix) or setenv.bat (for Windows). This file is not present by default in Tomcat but if you create one, it will be picked up by startup script.

    The reason why you should be using this instead of server.xml is that server.xml might change from one Tomcat version to another but setenv.sh (or .bat) is completely custom to you.

    Reading this value is, as you pointed out, through System.getProperty(...).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may sound like stupid question. How do I do something like this. Module
This may seem like a stupid Question but i have two cubes being rendered
This may be a stupid question, but it's something that bugs me on a
This may be a stupid question but I have a code with the following
This may be a stupid question, but I have to ask! I have the
This may sound like a stupid question but I can't seem to find an
This may seem like a basic/stupid/obviously-answered question, but I wanted to check: why use
This may be a stupid question but one that is throwing me for a
This may be a stupid question for some of you but I need to
This may sound like a stupid question, but how can I start to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.