Setting a Java System Property

Posted on 2005-04-26
Last Modified: 2010-03-17

I have no knowledge of Java Application Servers or how they work.  But I am in charge of installing a Java web application.  I have managed to install the Java JRE/SDK 1.4.2 and JBoss 3.2.3 with embedded Tomcat.  I can get the jmx-console to come up so I figure I can begin installing this application.  I am following the steps, but I am stuck on this step because I don't know how to do it:

"This software needs to know which type of database is being used.  Do this by setting a Java System Property in the application server (such that deployed applications have access to the property).  The name of the property should be 'RGDBTYPE' with a value of 'oracle'. "

What is this and how would I go about doing this?  I sifted through the JBoss directories but couldn't find a properties type file other than server/default/conf/, but it looked like I shouldn't be messing with it.  

Please be as detailed as possible and also explain how these properties work please.  Thanks.

Question by:dentyne
    LVL 19

    Accepted Solution

    Java System properties can be set during startup of Java Virtual Machine by providing following syntax -Dpropertyname=propertyvalue.
    In you case you should modify you run.bat or file. Find JAVA_OPTS="$JAVA_OPTS$PROGNAME" line in file which you use for jboss startup and add your property=value. It should be like that:
    and restart jboss.
    LVL 1

    Author Comment

    Thanks for the reply.  So would this be correct?  I found the line I think you are describing and I added my property.

    rem Setup JBoss specific properties

    What is the "D" for before? Should my RGDBTYPE have this "D" in front of it?  Also, does oracle have to be in quotation marks?  THanks.
    LVL 19

    Expert Comment

    other -D option is some internal system property for jboss.
    It doesn't matter where you put your -D parameter in that line.
    oracle shouldn't be in quotation marks.
    Your line should be:
    LVL 1

    Author Comment

    Thanks for the help.  I really appreciate it.  I'm sure I will have more questions later.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    NetScaler load balancer for Linux containers

    Get all the features you need to load balance your containerized microservices applications from NetSCaler CPX Express. Integrated with Google Kubernetes, Docker Swarm, and Apache Mesos container management systems.  Supported by Citrix. Free trial version. Deploy in minutes.

    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now