You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, the user had no way to specify custom JAVA_OPTS to be used
when the application was running. This change adds the ability for
the user to specify java.opts in system.properties and to have the
value added to the JAVA_OPTS contributed by the buildpack components.
[#49694697]
@@ -58,7 +60,10 @@ The buildpack contributes a number of standard components that enable most Java
58
60
59
61
<aname='openjdk'></a>
60
62
## OpenJDK JRE
61
-
**Criteria:**`java.runtime.vendor` set to `openjdk`
63
+
|||
64
+
| - | -
65
+
| **Detection Criteria** | `java.runtime.vendor` set to `openjdk`
66
+
| **Detection Tags** | `jre-openjdk-<version>`
62
67
63
68
The OpenJDK JRE provides Java runtimes from the [OpenJDK][openjdk] project. Versions of Java from the 1.6, 1.7, and 1.8 lines are available. If the version to use is not configured in `system.properties`, the latest version from the `1.7.0` line is chosen.
64
69
@@ -106,11 +111,20 @@ The OpenJDK JRE allows the configuration of the version of Java to use as well a
106
111
107
112
If some memory sizes are not specified using the above properties, default values are provided. For maximum heap, Metaspace, or PermGen size, the default value is based on a proportion of the total memory specified when the application was pushed. For stack size, the default value is one megabyte.
108
113
109
-
If any memory sizes are specified which are not equal to the default value, the proportionate defaults are adjusted accordingly. The default stack size is never adjusted from the default value.
114
+
If any memory sizes are specified which are not equal to the default value, the proportionate defaults are adjusted accordingly. The default stack size is never adjusted from the default value.
115
+
116
+
#### OpenJDK Memory Heuristics
117
+
118
+
The calculation of default memory sizes for OpenJDK is configured via YAML files in the buildpack's `config` directory.
119
+
120
+
The configuration contains a weighting between `0` and `1` corresponding to a proportion of the total memory specified when the application was pushed. The weightings should add up to `1`.
110
121
111
122
<aname='javamain'></a>
112
123
## Java Main Class Container
113
-
**Criteria:**`Main-Class` attribute set in `META-INF/MANIFEST.MF` or `java.main.class` set
124
+
|||
125
+
| - | -
126
+
| **Detection Criteria** | `Main-Class` attribute set in `META-INF/MANIFEST.MF` or `java.main.class` set
127
+
| **Detection Tags** | `java-main`
114
128
115
129
The Java Main Class Container allows applications that provide a class with a `main()` method in it to be run. These applications are run with a command that looks like `./java/bin/java -cp . com.gopivotal.SampleClass`.
116
130
@@ -119,7 +133,25 @@ The Java Main Class Container allows applications that provide a class with a `m
119
133
120
134
| Name | Description
121
135
| ---- | -----------
122
-
| `java.main.class` | The Java class name to run. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line. If not specified, the Java Manifest value of `Main-Class` is used.
136
+
| `java.main.class` | The Java class name to run. Values containing whitespace are rejected with an error, but all others values appear without modification on the Java command line. If not specified, the Java Manifest value of `Main-Class` is used.
137
+
138
+
<aname="javaopts"></a>
139
+
## `JAVA_OPTS` Framework
140
+
|||
141
+
| - | -
142
+
| **Detection Criteria** | `java.opts` set
143
+
| **Detection Tags** | `java-opts`
144
+
145
+
The `JAVA_OPTS` Framework contributes arbitrary Java options to the application at runtime.
146
+
147
+
<aname="javaopts"></a>
148
+
### Configuration
149
+
150
+
| Name | Description
151
+
| ---- | -----------
152
+
| `java.opts` | The Java options to use when running the application. All values are used without modification when invoking the JVM.
153
+
154
+
123
155
124
156
125
157
# Extending
@@ -144,8 +176,8 @@ def initialize(context = {})
144
176
145
177
# Determines if the JRE can be used to run the application.
146
178
#
147
-
#@return[String, nil]If the JRE can be used to run the application, a +String+ that uniquely identifies the JRE
148
-
#(e.g. +jre-openjdk-1.7.0_21+). Otherwise, +nil+.
179
+
#@return[String, nil] If the JRE can be used to run the application, a +String+ that uniquely identifies the JRE
0 commit comments