wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Adding a path in classpath variable of jboss startup file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Adding a path in classpath variable of jboss startup file" Watch "Adding a path in classpath variable of jboss startup file" New topic
Author

Adding a path in classpath variable of jboss startup file

Mohd Shah
Greenhorn

Joined: Apr 27, 2012
Posts: 1
I am new with jboss
I want to add following path in classpath variable of jboss startup file.

C:/sw/abc.properties.

Can anybody help what are the basic steps.

Raghav Viswanathan
Greenhorn

Joined: Apr 26, 2012
Posts: 26

Hello Mohd Shah,

you would need to use -D option in the run.bat file in the bin directory in JBOSS server.

A sample would be
-Dabc.properties=C:/sw/abc.properties

then you can access this path in the code with System.getProperty("abc.properties").toString(); This would return me the property file Location

Hope this helps.

Thanks and regards
Raghav.V


Better late than never.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

You can modify JBoss server\conf\jboss-service.xml as in this example:


i encourage you though to study the documentation available in this matter.

WP
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

Another way: copy the abc.properties file to server/xxx/conf - that directory is in the classpath. This is usually preferred to adding to the classpath if you want to have a properties file that is external to your WAR or EAR file.


JBoss In Action
 
wood burning stoves
 
subject: Adding a path in classpath variable of jboss startup file
 
Similar Threads
Setting System Class Path
Using jdbc from jsp with MySQL
Problems Running BEA Weblogic Server
linux beginner to conifg the jboss
Jboss start on system bootup