Error when setting G1 GC on Elastic Bean Stalk

Ramon Lacava :

I'am trying to set G1 GC on elastic bean stalk using JVM options by UI using the following argument: –XX:+UseG1GC.

But when i try to restart the instance, the following error is thrown:

Error: Could not find or load main class ?XX:+UseG1GC

Why this is happening ?

Some informations:

java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

Environment:

Tomcat 8 with Java 8 running on 64bit Amazon Linux/2.6.2
Karol Dowbecki :

You are using en dash character instead of hyphen - character. The JVM options are defined with a hyphen, it should be (notice the short -):

-XX:+UseG1GC 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=159316&siteId=1