ZGC not supported with OpenJDK 11 and macOS? - java

I'm trying to run a spring boot application with ZGC Garbage Collector, with following JVM options passed in build.gradle:
bootRun {
jvmArgs = ["-XX:+UnlockExperimentalVMOptions", "-XX:+UseZGC", "-Xlog:gc*"]
}
While running an app (gradle bootRun) I'm getting following error:
> Task :bootRun FAILED
Error occurred during initialization of VM
Option -XX:+UseZGC not supported
java -version:
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
I'm running 10.15.2 (19C57) version of macOS (Catalina) if that helps. Is it only macOS issue?

You can find the details over the supported platforms under the ZGC wiki.
So as it seems like, you would have to move to JDK-14 to be able to use it with macOS.

Related

IntelliJ won't recognize JDK on Ubuntu

I installed openjdk using the command:
sudo apt install openjdk-11-jre-headless
java -version command correctly displays the installed package
openjdk 11.0.15 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1, mixed mode, sharing)
However, when I open the IntelliJ IDEA environment, and want to run the first project, the environment does not detect the sdk
Should I configure something else beforehand, I haven't had much experience with Ubuntu before, for comparison in windows using the command -java version I get this message: completely different from what I get on ubuntu and everything works fine
java version "17" 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
That's because you've installed JRE instead of JDK.
see: What is the difference between JDK and JRE?
Just try sudo apt install openjdk-17-jdk

JDK8 for NetBeans 12.2?

I'm trying to install JDK8 as a platform on NetBeans 12.2, but I keep getting this error message:
"Cannot detect and install the selected platform. The java or javac may not be executable."
Is there a way around this? Or is there a version of JDK8 that won't yield this error message?
Further: I should have mentioned that I'm on MACOS Big Sur.
Here's what I get with java -version in Terminal:
java version "15.0.2" 2021-01-19 Java(TM) SE Runtime Environment (build 15.0.2+7-27) Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
And here's what I get with javac -version:
javac 15.0.2
You are probably getting this message because the JDK executables haven't been added to your path as environment variables. Directly from the official java website, here's a guide on how to fix this problem.

elasticsearch install plugin: Could not reserve enough space for object heap

I am trying to install the elasticsearch plugin with the command: ./plugin install license which I found on this tut: link
But I get the error message:
Error occurred during initialization of VM
Could not reserve enough
space for object heap Error: Could not create the Java Virtual
Machine. Error: A fatal exception has occurred. Program will exit.
After that even if I run java -version I get the same error! Before I run ./plugin install license java -version worked fine and printed:
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
Does anybody know whats my problem here? Its a fresh install of Ubuntu 14.04.4 LTS and I installed elasticsearch 2.2.3
Installation for ElasticSearch
1) Comment entry in C:\\elasticsearch-5.4.0\elasticsearch-5.4.0\config\jvm.options
#-Xms2g
#-Xmx2g
2) set ES_JAVA_OPTS as below in elasticsearch.bat
set ES_JAVA_OPTS = "-Xms512m -Xmx512m"

A working Java 8 is required to run Solr?

solr version is 6.0.0
When I run
>bin/solr -e example
error with
Java not found, or an error was encountered when running java.
A working Java 8 is required to run Solr!
Please install Java 8 or fix JAVA_HOME before running this script.
Command that we tried: 'java -version'
Active Path:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
my java version is
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
and my PATH is
/opt/java/bin:/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I edit the bin/solr
116 JAVA=java
to
116 JAVA=/opt/java/bin/java
then it works!
Ran into a similar issue on 5.5, this link helped me: https://www.garysieling.com/blog/install-solr-ubuntu

RHEL Java taking too long to start

I have installed RHEL 6.5 and am facing a performance issue with java.
# time java -version
java version "1.6.0_34"
OpenJDK Runtime Environment (IcedTea6 1.13.6) (rhel-1.13.6.1.el6_6-x86_64)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
real 0m45.243s
user 0m0.149s
sys 0m0.086s
Try to install version java version "1.8.0_31" and see if the numbers does improve.
rpm -ivh jdk-8u31-linux-x64.rpm
Also check the configuration page from RHEL. https://access.redhat.com/documentation/en-US/JBoss_Communications_Platform/5.0/html/Platform_Installation_Guide/chap-Installing_and_Configuring_Java.html
I found out that it was McAfee's nails process which was slowing down not only java but many other system processes. Stopping resolved the issue.

Categories