Does OpenJDK 1.8 support JFR? - performance

I'm not sure if OpenJDK 1.8 supports JFR (java flight recorder). I know it was requested on the OpenJDK bugs forum.
Using OpenJDK on Linux and executing the following from a terminal:
jcmd `<pid>` JFR.start
returns
java.lang.IllegalArgumentException: Unknown diagnostic command

The OpenJDK 8 source code does not include the Java Flight Recorder implementation. That feature has been targeted to become part of OpenJDK source code with JDK 11, per http://openjdk.java.net/projects/jdk/11/ .

Officially, JFR was included in OpenJDK 8 update 262. You can check the release notes for openjdk8u262.
New features - JDK-8223147: JFR Backport
You can download this (or latest with JFR) release from the AdoptOpenJDK.

Java Flight Recorder is a commercial product included in Java SE Advanced that is only included in the Oracle JDK and not in OpenJDK.

Java flight recorder is not a part of 8th version but has to be open-sourced and included in 11th release according to
http://openjdk.java.net/jeps/328
https://bugs.openjdk.java.net/browse/JDK-8193393
Update(it's there):
https://mail.openjdk.java.net/pipermail/announce/2018-September/000257.html

Available in OpenJDK 8u262.
New features
JDK-8223147: JFR Backport
https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-July/012143.html

Per http://hirt.se/blog/?p=1161 the JFR Backport to OpenJDK 8 is officially planned and already available to try in some builds: https://www.infoq.com/news/2020/02/jfr-coming-to-openjdk-8/

Related

sonarqube-8.6.1 unable to start in windows

I am unable to start the sonarqube in my local windows machine, Getting the below error,
I have set java path and it's working fine,
Regarding to the https://docs.sonarqube.org/8.6/requirements/requirements/ which describes as the following: -
Prerequisite
The only prerequisite for running SonarQube is to have Java (Oracle JRE 11 or OpenJDK 11) installed on your machine.
Supported Platforms
Java
SonarQube scanners require version 8 or 11 of the JVM
SonarQube server requires version 11. Versions beyond Java 11 are not officially supported.
Then this is a root cause why we face this failure message when we run it against the JDK version 8
I would suggest to download the JDK version 11 and use it so that we meet the SonarQube Server requirement.

supported java versions for quarkus running on hotspot

I read the docs from quarkus and it is said that the following jdk versions are supported:
JDK 8 or 11+ installed with JAVA_HOME configured appropriately
Actually, I have JDK 12 installed. Can I use the following?:
<maven.compiler.release>1.11</maven.compiler.release>
maven.compiler.release is the same as:
<maven.compiler.source>1.11</maven.compiler.source>
<maven.compiler.target>1.11</maven.compiler.target>
EDIT:
Quarkus works with:
<maven.compiler.source>1.12</maven.compiler.source
<maven.compiler.target>1.12</maven.compiler.target>
or
<-- Note: 12 instead of 1.12 -->
<maven.compiler.release>12</maven.compiler.release>
Update: starting with Quarkus 2.x, the minimal requirement is JDK 11+. JDK 17 is supported too.
JDKs newer than 17 should work but are not actively tested.
====
On Linux and MacOS, you can use JDK 8 to 13.
On Windows, you can use JDK 8 to 12 as we are affected by a JDK bug: see https://github.com/quarkusio/quarkus/issues/5359 .
You can compile to something specific to your version if you are only planning to use the said JVM.
As for why our examples are all using JDK 8: they are built to also support native images via GraalVM and until very recently GraalVM only supported JDK 8. GraalVM 19.3.0 just added support for JDK 11 as a preview (and we are working on it).
You can use Quarkus with Java 12. There are plenty of ways to configure Maven to use that version, see this for example.

Where to get Fastdebug/Debug build of JDK 8 for Windows?

I want to get a JDK 8 that was built with debug or fastedebug option to investigate a low-level performance-related problem. To be more specific, I want a JDK 8 64-bit build for Windows that supports -XX:+PrintMethodData option.
However I can't find any public debug-enabled JDK build for Windows. Is my only option to take OpenJDK and build it myself?
PS: I don't need a production quality JDK. I just want to get more info from JIT.
PS2: Related links:
https://github.com/alexkasko/openjdk-unofficial-builds - OpenJDK. Only JDK 6 and 7.
https://github.com/ojdkbuild/ojdkbuild - OpenJDK 8 but no debug versions.
I can't find any public debug-enabled JDK build for Windows.
I added "fastdebug" binaries that match latest "ojdkbuild" release:
direct download: https://github.com/ojdkbuild/ojdkbuild/releases/download/1.8.0.111-1/java-1.8.0-openjdk-fastdebug-1.8.0.111-1.b15.ojdkbuild.windows.x86_64.zip
sha256: https://github.com/ojdkbuild/ojdkbuild/releases/download/1.8.0.111-1/java-1.8.0-openjdk-fastdebug-1.8.0.111-1.b15.ojdkbuild.windows.x86_64.zip.sha256
Debuginfo there is zipped in .diz files in jre/bin and jre/bin/server directories.
Debug binaries are planned for following "ojdkbuild" builds, but not yet implemented in build scripts, see: https://github.com/ojdkbuild/ojdkbuild/issues/7 , if you'll have any specific requirements about debug symbols - I will appreciate comments there.
Is my only option to take OpenJDK and build it myself?
Building vanilla OpenJDK 8 for Windows is relatively easy, just note that it supports only VS2010 (SDK 7.1) toolchain.

How to run sonarqube on NetBSD

According to the requirements document for sonarqube:
The only prerequisite for running SonarQube is to have Java (Oracle JRE 7 onwards or OpenJDK 7 onwards) installed on your machine.
I want now to use a NetBSD 7.0 machine to run a sonarqube server.
OpenJDK8 is installed:
openjdk version "1.8.0_77-internal"
OpenJDK Runtime Environment (build
1.8.0_77-internal-pkgsrc_1.8.77-b00)
OpenJDK 64-Bit Server VM (build 25.77-b00, mixed mode)
However, sonarqube is using wrapper, and that software does not support NetBSD (FreeBSD is supported, but this is not close enough to serve as a working substitute).
I already tried using linux emulation mode. But, having a NetBSD native java being started from a linux emulated wrapper is not giving a usable configuration for runtime environment (libc version clashes, et. al.).
And installing a linux native openjdk8 and get the complete setup running in emulation mode is also not to be recommended.
With sonarqube 4.x (long ago) I had used war distribution
and this worked OK. But with this new environment I hoped for being able to use newer versions of sonarqube.
Questions:
Is there a way to bypass wrapper and start sonarqube relying on java only?
Alternatively, is there a way to get a NetBSD version of wrapper?
Would I be better of dropping sonarqube alltogether,
given my target platform?
The version of Java Service Wrapper used by SonarQube does not support NetBSD. That's not as critical as for MSWindows. SonarQube can be easily started as a unix daemon without it. You just have to execute java -jar lib/sonar-application-{version}.jar from the installation directory.

How to change JRE for PhpStorm on MacOs

It seems, with the latest MAcOs updates, that Java was also updated, which influenced PhpStorm performance very badly.
Anyway, I decided to update my Java.
Was
$ java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
After downloading Java SDK from Oracle and installing:
$ java -version
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)
But in PhpStorm it still shows the old JRE:
I also restarted my computer, but still the old JRE is shown.
Please help, how to make PHPStorm use a new JRE?
Quoting from the "Selecting the JDK version the IDE will run under" article in the Knowledge Base
posted on March 27, 2013
Mac OS X
At the moment all our products require Apple JDK 1.6 to be installed in order to run on Mac. JDK 1.7 from Oracle is not officially supported yet and has known problems that stop us from using it by default. Oracle JDK 1.7.0_40 has added support for Retina and works much better than previous versions on Mac. You are welcome to give it a try in case you have any problems with Apple JDK.
To force running under JDK 1.7 edit /Applications/.app/Contents/Info.plist file, change JVMVersion from 1.6* to 1.7* :
<key>JVMVersion</key>
<string>1.7*</string>
See this answer for the known problems with JDK 1.7.
IDEA_JDK environment variable can be used to override the selected JDK, you may need to run the product from the Terminal so that it sees your environment variables (Mac OS limitation): open -a /Applications/.app/ .
Application About dialog will show the actual JDK version.

Resources