In Full WebSphere Application server I have added a Custom properties file in APP Server > Server1 > Process Definition > Java Virtual Machine > custom properties
> that points a configuration file on my windows system. I want to do the same for WebSphere Liberty, but cant seem to know where to put it or what the format would be. I tried jvm.options
but not sure of syntax , that file requires to only use JVM arguments
Asked
Active
Viewed 6,215 times
0
-
1usage of JVM options for Liberty is documented here: http://www.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_admin_customvars.html – Andy Guibert Mar 25 '16 at 23:57
-
Okay, I tried to add it in jvm.options... but it needs a JVM syntax which I in my full WAS install I have a name which seems to be anything you want and the location of the properties files which is an XML file, is there -D type of format that is required in the jvm.options , it seems you can also place it in the bootstrap.properties but again need a format... But appreciate the comment, but does not really help – RTercero Mar 26 '16 at 03:08
-
Can you update your question to show what you have tried? It would be helpful to know what your Full WAS xml file looks like and how you are attempting to translate that to jvm.options in Liberty. Examples of the syntax for jvm.options are shown in the doc I linked earlier. – Andy Guibert Mar 26 '16 at 04:59
-
@aguibert You should probably just make an answer with a link and copy/paste an example of a system property. – Brett Kail Mar 26 '16 at 14:42
1 Answers
2
For WebSphere Liberty you can place a jvm.options file in ${wlp.install.dir}/etc/jvm.options
or ${server.config.dir}/jvm.options
. Note that if both files are present, the jvm.options
in ${server.config.dir}
will be used.
Here is what a jvm.options
file might look like:
# Set the maximum heap size to 1024m
-Xmx1024m
# Set a system property.
-DsomePropertyName=somePropertyValue
# Enable verbose garbage collection.
-verbose:gc
Note that the format for the property file is exactly the same as what you would pass into the java
command normally. The main difference is that for jvm.options
each property must be on it's own line.
The jvm.options
shown above would be equivalent to launching a java process like this:
java -Xmx1024m -DsomePropertyName=somePropertyValue -verbose:gc
Reference:
IBM Knowledge Center - Customizing the Liberty environment

Andy Guibert
- 41,446
- 8
- 38
- 61
-
Hi, I put this into the jvm.options Dtnt4jconfig="file:C:IBM/WebSphere/Liberty/wlp/usr/mylibStream/tnt4j.properties"..... and my tnt4J.properties file pretty much looks like tnt4j type of coding.... – RTercero Mar 26 '16 at 21:28
-
sorry hit enter too soon.....;Default tracking configuration for all sources (source: *), ;used only if no other stanza matches. { source: * source.factory: com.nastel.jkool.tnt4j.source.SourceFactoryImpl source.factory.GEOADDR: Maryland source.factory.DATACENTER: HQDC source.factory.RootFQN: RUNTIME=?#SERVER=?#NETADDR=?#DATACENTER=?#GEOADDR=? tracker.factory: com.nastel.jkool.tnt4j.tracker.DefaultTrackerFactory dump.sink.factory: – RTercero Mar 26 '16 at 21:29
-
I have tried adding in server.xml the following two options at separate times
-
Why are you making this so complicated? All you need is add the same -Dfoo=bar you'd put on a command-like java invocation onto its own line in jvm.options. – covener Mar 27 '16 at 00:36
-
okay I got it to work, so your saying remove all of the other library entries from server.xml. I redeployed the war file in eclipse mars2 and added as an ear and it picked up all my changed and now I'm getting my metrics... Sorry if I was making it complicated , I was just trying whatever I could to get it working.. I'm new to Java coding, really more o an admin. I deleted everything from eclipse and my liberty directory and followed this path https://www.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/t_add_app.html ... RT – RTercero Mar 27 '16 at 02:13
-
I'll start removing everything and I really now believe that just adding the java -D and deploying correctly in eclipse was the entire problem – RTercero Mar 27 '16 at 02:15