| type=page |
| status=published |
| title=create-jvm-options |
| next=create-lifecycle-module.html |
| prev=create-jndi-resource.html |
| ~~~~~~ |
| |
| = create-jvm-options |
| |
| [[create-jvm-options-1]][[GSRFM00042]][[create-jvm-options]] |
| |
| == create-jvm-options |
| |
| Creates options for the Java application launcher |
| |
| [[sthref369]] |
| |
| === Synopsis |
| |
| [source] |
| ---- |
| asadmin [asadmin-options] create-jvm-options [--help] |
| [--target target] [--profiler={true|false}] |
| (jvm-option-name=jvm-option-value) [:jvm-option-name=jvm-option-value*] |
| ---- |
| |
| [[sthref370]] |
| |
| === Description |
| |
| The `create-jvm-options` subcommand creates command-line options that |
| are passed to the Java application launcher when {productName} is |
| started. The options that this subcommand creates are in addition to the |
| options that are preset with {productName}. Java application |
| launcher options are stored in the Java configuration `java—config` |
| element or the profiler `profiler` element of the `domain.xml` file. The |
| options are sent to the command line in the order they appear in the |
| `java—config` element or the profiler `profiler` element in the |
| `domain.xml` file. |
| |
| Profiler options are used to record the settings that are required to |
| start a particular profiler. The profiler must already exist. If |
| necessary, use the |
| link:create-profiler.html#create-profiler-1[`create-profiler`(1)] |
| subcommand to create the profiler. |
| |
| This subcommand can be used to create the following types of options: |
| |
| * Java system properties. These options are set through the `-D` option |
| of the Java application launcher. For example: |
| + |
| `-Djava.security.manager` |
| + |
| `-Denvironment=Production` |
| |
| * Startup parameters for the Java application launcher. These options |
| are preceded by the dash character (`-`). For example: |
| + |
| ``--XX:PermSize=``size |
| + |
| `-Xmx1024m` |
| + |
| `-d64` |
| |
| If the subcommand specifies an option that already exists, the command |
| does not re-create the option. |
| |
| |
| [NOTE] |
| ==== |
| Ensure that any option that you create is valid. The subcommand might |
| allow you to create an invalid option, but such an invalid option can |
| cause startup to fail. |
| ==== |
| |
| |
| An option can be verified by examining the server log after |
| {productName} starts. Options for the Java application launcher are |
| written to the `server.log` file before any other information when |
| {productName} starts. |
| |
| The addition of some options requires a server restart for changes to |
| become effective. Other options are set immediately in the environment |
| of the domain administration server (DAS) and do not require a restart. |
| Whether a restart is required depends on the type of option. |
| |
| * Restart is not required for Java system properties whose names do not |
| start with `-Djava.` or `-Djavax.` (including the trailing period). For |
| example, restart is not required for the following Java system property: |
| + |
| `-Denvironment=Production` |
| |
| * Restart is required for the following options: |
| |
| ** Java system properties whose names start with `-Djava.` or `-Djavax.` |
| (including the trailing period). For example: |
| + |
| `-Djava.security.manager` |
| |
| ** Startup parameters for the Java application launcher. For example: |
| + |
| `-client` |
| + |
| `-Xmx1024m` |
| + |
| `-d64` |
| |
| To restart the DAS, use the |
| link:restart-domain.html#restart-domain-1[`restart-domain`(1)] command. |
| |
| This subcommand is supported in remote mode only. |
| |
| [[sthref371]] |
| |
| === Options |
| |
| asadmin-options:: |
| Options for the `asadmin` utility. For information about these |
| options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page. |
| `--help`:: |
| `-?`:: |
| Displays the help text for the subcommand. |
| `--target`:: |
| Specifies the target on which you are creating Java application |
| launcher options. + |
| Valid values are as follows: |
| |
| `server`;; |
| Specifies the DAS (default). |
| instance-name;; |
| Specifies a {productName} instance. |
| cluster-name;; |
| Specifies a cluster. |
| configuration-name;; |
| Specifies a named configuration. |
| |
| `--profiler`:: |
| Indicates whether the Java application launcher options are for the |
| profiler. The profiler must exist for this option to be true. Default |
| is false. |
| |
| [[sthref372]] |
| |
| === Operands |
| |
| jvm-option-name:: |
| One or more options delimited by a colon (:). The format of an option |
| depends on the following: |
| |
| * If the option has a name and a value, the format is option-name=value. |
| * If the option has only a name, the format is option-name. |
| For example, `-Xmx2048m`. |
| * If the first option name could be misinterpreted as one or more |
| `asadmin` short options, the format is `--` option-name. For example, |
| `-server` in the following command could be misinterpreted as `-se`, |
| the `asadmin` short forms for `--secure` and `--echo`: |
| + |
| [source] |
| ---- |
| create-jvm-options -server |
| ---- |
| + |
| To create the JVM option `-server`, instead use the command: |
| + |
| [source] |
| ---- |
| create-jvm-options -- -server |
| ---- |
| + |
| [NOTE] |
| ==== |
| If an option name or option value contains a colon, the backslash |
| (`\`) must be used to escape the colon in the name or value. Other |
| characters might also require an escape character. For more |
| information about escape characters in subcommand options, see the |
| link:asadmin.html#asadmin-1m[`asadmin`(1M)] man page. |
| ==== |
| |
| [[sthref373]] |
| |
| === Examples |
| |
| [[GSRFM500]][[sthref374]] |
| |
| ==== Example 1 Setting Java System Properties |
| |
| This example sets multiple Java system properties. |
| |
| [source] |
| ---- |
| asadmin> create-jvm-options -Dunixlocation=/root/example: |
| -Dvariable=\$HOME:-Dwindowslocation=d\:\\sun\\appserver:-Doption1=-value1 |
| created 4 option(s) |
| Command create-jvm-options executed successfully. |
| ---- |
| |
| [[GSRFM501]][[sthref375]] |
| |
| ==== Example 2 Setting a Startup Parameter for the Java Application |
| Launcher |
| |
| This example sets the maximum available heap size to 1024. |
| |
| [source] |
| ---- |
| asadmin> create-jvm-options -Xmx1024m |
| created 1 option(s) |
| Command create-jvm-options executed successfully. |
| ---- |
| |
| [[GSRFM502]][[sthref376]] |
| |
| ==== Example 3 Setting Multiple Startup Parameters for the Java Application |
| Launcher |
| |
| This example sets the maximum available heap size to 1024 and requests |
| details about garbage collection. |
| |
| [source] |
| ---- |
| asadmin> create-jvm-options "-Xmx1024m:-XX\:+PrintGCDetails" |
| created 1 option(s) |
| Command create-jvm-options executed successfully. |
| ---- |
| |
| In this case, one of the two parameters already exists, so the |
| subcommand reports that only one option was set. |
| |
| [[GSRFM503]][[sthref377]] |
| |
| ==== Example 4 Setting a JVM Startup Parameter for the Profiler |
| |
| This example sets a JVM startup parameter for the profiler. |
| |
| [source] |
| ---- |
| asadmin> create-jvm-options --profiler=true -XX\:MaxPermSize=192m |
| created 1 option(s) |
| Command create-jvm-options executed successfully. |
| ---- |
| |
| [[sthref378]] |
| |
| === Exit Status |
| |
| 0:: |
| subcommand executed successfully |
| 1:: |
| error in executing the subcommand |
| |
| [[sthref379]] |
| |
| === See Also |
| |
| link:asadmin.html#asadmin-1m[`asadmin`(1M)] |
| |
| link:create-profiler.html#create-profiler-1[`create-profiler`(1)], |
| link:delete-jvm-options.html#delete-jvm-options-1[`delete-jvm-options`(1)], |
| link:list-jvm-options.html#list-jvm-options-1[`list-jvm-options`(1)], |
| link:restart-domain.html#restart-domain-1[`restart-domain`(1)] |
| |
| For more information about the Java application launcher, see the |
| reference page for the operating system that you are using: |
| |
| * Oracle Solaris and Linux: java - the Java application launcher |
| (`http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/java.html`) |
| * Windows: java - the Java application launcher |
| (`http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html`) |
| |
| |