Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding a path in classpath variable of jboss startup file

 
Mohd Shah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic