Questions tagged [java-17]

JavaSE 17 is the latest java version which is also long term support. Use this tag for issues with JavaSE 17.

Java SE 17 is the latest java version which is also long term support. Use this tag for issues with Java SE 17.

841 questions
18
votes
2 answers

Criteria for default garbage collector Hotspot JVM 11/17

I found a source describing that the default gc used changes depending on the available resources. It seems that the jvm uses either g1gc or serial gc dependnig on hardware and os. The serial collector is selected by default on certain hardware and…
Paul7979
  • 210
  • 1
  • 3
  • 10
18
votes
1 answer

jenv can't find java 17 installed through the brew on MacOS

I'm trying to install JDK 17 to macOS BigSur (11.5.2) using brew install openjdk@17 > brew install openjdk@17 Running `brew update --preinstall`... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae Updated 3…
lazylead
  • 1,453
  • 1
  • 14
  • 26
18
votes
8 answers

Eclipse not able to open java files -> Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass

Getting the following error, after adding Lombok lib An error has occurred. See error log for more details. Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
16
votes
2 answers

What is 'serviceability memory category' of Native Memory Tracking?

I have an java app (JDK13) running in a docker container. Recently I moved the app to JDK17 (OpenJDK17) and found a gradual increase of memory usage by docker container. During investigation I found that the 'serviceability memory category' NMT…
Egor
  • 2,122
  • 2
  • 21
  • 23
16
votes
3 answers

Starting from which version Gradle supports Java 17

When trying to configure the project I'm getting the error: Unsupported Java. Your build is currently configured to use Java 17.0.1 and Gradle 7.0. Unfortunately there are no information in official documentation for now.
Nolequen
  • 3,032
  • 6
  • 36
  • 55
15
votes
1 answer

Use Javascript scripting engine in Java 17

I have to move a project from Java 8 to Java 17. I could solve most issues, but it contains a method, in which I use the ScriptEngineManager to evaluate a mathematical term. ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine e =…
JustMe
  • 366
  • 1
  • 4
  • 14
15
votes
2 answers

Powermock Compatibility with JDK 17

Recently I was upgrading my project from JDK 11 to JDK 17. After upgrading, powermock seems to have an issue. While running AUT's , I am getting following error: java.lang.RuntimeException: PowerMock internal error: Should never throw exception at…
sanchit relan
  • 151
  • 1
  • 1
  • 5
15
votes
1 answer

Java 17 with Maven Wrapper results in Unrecognized VM option 'MaxPermSize=512m'

I use OpenJDK 17 with Maven Wrapper 3.8.2 from Spring Initializr (Maven project, JAR packaging, Java 17, Spring Boot 2.6.0). No additional dependencies. user@DESKTOP-U2OU5HG MINGW64 /c/Projects/my-project (master) $ java -version openjdk version…
Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183
14
votes
2 answers

What is the difference between a final Class and a Record?

In simple words what is the difference between a final class and a record in Java 17? In which case should I use a record?
13
votes
3 answers

Unsupported class file major version 61

I am trying to integrate Glowroot into my Java application. Unfortunately, I get the following error: 2022-05-13 09:25:57.777 ERROR o.g.a.w.PointcutClassFileTransformer - Unsupported class file major version 61 java.lang.IllegalArgumentException:…
Moritz
  • 307
  • 1
  • 4
  • 10
13
votes
1 answer

`Unrecognized VM option 'CMSClassUnloadingEnabled'` after switching to java 17

After changing the Java version to 17 I can't build the Gradle project. I am using Gradle 7.3.1 version and have the following line in Gradle properties: org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xms1g -Xmx4g -XX:+UseG1GC…
Wiktor Kęska
  • 411
  • 2
  • 4
  • 13
12
votes
0 answers

Seeded RandomGenerators in Java 17

Java 17 has introduced a new RandomGeneratorFactory class for instantiating random number generators. The create(long) method is described as Create an instance of RandomGenerator based on algorithm chosen providing a starting long seed. If long…
cpp beginner
  • 512
  • 6
  • 23
12
votes
1 answer

Migrating from jaxb xjc generation to jakarta and Java 17

We are in the process of investigating the migration of our application from JDK8 to JDK17. Some of our modules use wsdl based web services, some others make use of .xsd schemas etc. Regardless, we make use of JAXWS and JAXB apis that are now…
PentaKon
  • 4,139
  • 5
  • 43
  • 80
11
votes
1 answer

Java 17 solution for Spark - java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.storage.StorageUtils

There are some solutions here Windows Spark Error java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.storage.StorageUtils The mentioned error probably corresponds to the following exception: java.lang.IllegalAccessError:…
Arnd Eden
  • 111
  • 1
  • 3
11
votes
6 answers

Cannot find supported Gradle version for JDK 17. The Gradle supports JDK versions 7 through 16

Just trying to create a Gradle project using the jdk17, facing the below issue. I know Gradlew 7.3 is required for JDK 17, but quite not sure from where I should set the version of Gradle Gradle location Gradle version
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
1
2
3
56 57