0

I added -XX:+UseG1GC option JAVA_OPTS but it didn't seem to work.

I installed only JRE 7 in this server so I'm just wondering if I need to install JDK 7.

JRE which is installed in the server is the following.

java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Do I have to install JDK?

kurikintoki
  • 839
  • 1
  • 8
  • 8
  • 2
    "*but it didn't seem to work*" - how do you know? Did you debug the garbage collection e.g. using VisualVM? Did you turn on GC logging? The core VM and the garbage collectors are identical between JDK and JRE –  Aug 17 '14 at 11:25

1 Answers1

2

If your application does not need to compile java code, you do not need a JDK.

The garbage collector options are specific to Java virtual machine (JVM). JRE is a distribution of the JVM. The -XX:+UseG1GC is valid as an option for recent versions of Java7 and all Java8. G1 GC is supported since Java 7u4. Do not use anything older.

You might be interested to install the JDK as it comes with tools like:

  • jmc
  • jvisualvm
  • jconsole
  • jstat
  • jmap/jhat
  • jinfo
  • jcmd
Mircea Vutcovici
  • 1,894
  • 19
  • 27