aspose file tools*
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
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: 859

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: 5830
    
    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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Adding a path in classpath variable of jboss startup file