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 8871863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:05:32+00:00 2026-06-14T18:05:32+00:00

I am debugging a problem in a large system. I was able to locate

  • 0

I am debugging a problem in a large system. I was able to locate the problem in a rather basic java feature – the application is started with the -D option to specify some system properties. During run-time though, said properties are not set and their values are null.

Trying to reproduce the issue I created the following very simple application:

  public static void main(String[] args) {
    String propName = "sysprop";
    String propValue = System.getProperty(propName);
    System.out.println(propName + "=" + propValue);
  }

I start the application with the following command line and to my surprise got the same result:

java -cp javaapplication8.jar javaapplication8.JavaApplication8
-Dsysprop="some value"

sysprop=null

Apparently I am missing something obvious (or lack some basic knowledge) but what is it?

Thank you.

  • 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-14T18:05:33+00:00Added an answer on June 14, 2026 at 6:05 pm

    You’re specifying -D after the classname, so it’s being treated as a regular command line argument to be passed on to the application itself. You would see that if you printed out the values in args.

    Run the app like this instead:

    java -cp javaapplication8.jar -Dsysprop="some value" javaapplication8.JavaApplication8 
    

    All arguments which are meant to apply to the environment rather than the application should come before the classname. If you run just java, you’ll see usage help like this:

    Usage: java [-options] class [args...]
               (to execute a class)
       or  java [-options] -jar jarfile [args...]
               (to execute a jar file)
    where options include
    [...]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we're having this big problem with our application. It's a rather large application with
I have a large project that executes without problem when not debugging (even when
While debugging a problem in a WPF application, I have noticed that the TwoWay
I'm debugging an intermittent problem in which an application (created using C++ in Visual
While debugging crash in a multithreaded application I finally located the problem in this
I am running into a bit of a problem in debugging a web application
I am having an odd problem. There is a large request I am debugging
I have a very large array I need to check for debugging purposes, problem
I have a problem debugging Invoke() or BeginInvoke() in Visual Studio 2008. For instance
I'm having a really difficult time debugging this problem. Whenever I try to establish

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.