Setting a Java System Property

Posted on 2005-04-26
Medium Priority
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/jndi.properties, 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
  • 2
  • 2
LVL 19

Accepted Solution

ramazanyich earned 2000 total points
ID: 13874957
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 run.sh file. Find JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME" line in file which you use for jboss startup and add your property=value. It should be like that:
and restart jboss.

Author Comment

ID: 13876563
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
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% -DRGDBTYPE="oracle"

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

ID: 13876689
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:
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% -DRGDBTYPE=oracle

Author Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack or Above. The following steps a…
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 …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

850 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