Questions tagged [java-11]

3

votes
0

answer
31

Views

When JRE was completely discontinued as separate offering?

Starting from Java 9 the module system was introduced, making provision of JRE separately redundant. Through, it seems that it was still possible to download it. For example, from here now Java 9 archive Also, here it's only stated that : Restructure the JDK and JRE run-time images to draw a clear d...
anasmi
1

votes
1

answer
36

Views

Ambiguous call to Module

I am trying to recompile a JAVA8 code in JAVA11. Getting below compilation errors. error: reference to Module is ambiguous private Module module; both interface com.module.Module in com.module and class java.lang.Module in java.lang match Being new to the Java not able to fully understand the root...
AKJ
0

votes
2

answer
28

Views

Efficient Java construct for Arraylist Processing and calling different methods

Please, Is there an elegant and efficient way of doing the following in Post Java 8 i.e. 1. Looping through an arraylist 2. Reading the object 3. Calling different methods of potentially different objects using the values contained in the arraylist items I did look at streams, switch statement, but...
olatom
0

votes
0

answer
4

Views

Unable to derive module descriptor for legacy signed JAR

I'm trying to update a software system to JDK-11 using modules, and everything was going just fine right up until I slammed head-on into the aforementioned issue. I have a legacy signed JAR that I need to incorporate for interaction with legacy systems. There's no way to update the JAR and no way to...
Diego Rivera
1

votes
1

answer
55

Views

sun.misc.Contended is not a member of package sun.misc Scala

I'm updating JDK version from 8 to 11 an get the issue with some concurrent data structure. error: type Contended is not a member of package sun.misc [ERROR] @sun.misc.Contended [ERROR] ^ [ERROR] one error found Is there a way to work around this? I'm using Scala 2.12.8?
Some Name
-1

votes
0

answer
15

Views

.java file showing unreadable characters

i was performing class file to exe conversion using jsmooth, may be due to misconfiguration Jsmooth gave and error and i closed it. now my original Main.java file is showing unreadable characters and my whole code is gone :( i have compiled it before using javac Main.java (using Windows PowerShell)...
Junaid Ahmed
1

votes
0

answer
109

Views

Looking for jar that defines javax.activity (no longer provided by java.corba module as per JEP 320) [duplicate]

This question already has an answer here: Unable to derive module descriptor for auto generated module names in Java 9? 1 answer Is there a replacement library for CORBA in JDK 11 2 answers I have a follow-up question in connection to Replacements for deprecated JPMS modules with Java EE APIs, in...
user9682953
1

votes
0

answer
103

Views

Maven JavaDoc Plugin Failing to parse XML

I have trying to generate Javadoc using the maven-javadoc-plugin and a custom doclet. I am using JDK 11 and I have implemented the methods of the Doclet interface. However, in one of the methods, I am trying to unmarshal an XML file. I am receiving the following error: javax.xml.bind.JAXBException:...
RobotWizard
1

votes
1

answer
197

Views

Invalid version of javafx.stage.Stage for JavaFX11

I created project in new Java SDK 11 based on this example: EntryPoint.java package com.example; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Label; public class EntryPoint extends javafx.application.Application { public static void main (String[] args) { launch(...
Gurebu Bokofu
1

votes
0

answer
36

Views

How to add a site that uses java to the Java exception list in JDK 11?

In the previous versions of Jdk (7-10) there was a java console, where we could add sites in Security->ExceptionSites. In JDK 11 Java Control Panel, which was used for configuring the deployment technologies, has been removed along with the shared system JRE (but not the server JRE) and the JRE Aut...
Radzzz
1

votes
0

answer
57

Views

Does JMOD Architecture Affect Javac Generated Class Files

I am compiling a Java 11 application, then linking for various architectures by calling the jlink command. Does the architecture of the jmod files used for the javac command affect the output in any way? Is it well-defined behavior to compile (javac) using the Windows jmod files, then link (jlink)...
Jeff G
1

votes
1

answer
387

Views

Internal API Replacement in Java 11

Can someone tell me the replacement of below listed API SunToolkit.getContainingWindow SwingUtilities2.getFontMetrics SwingUtilities2.stringWidth SwingUtilities2.drawString SwingUtilities2.clipStringIfNecessary SwingUtilities2.setLeadAnchorWithoutSelection DefaultLookup.getIcon And below listed clas...
Maha Lax
1

votes
0

answer
343

Views

Java 11 / IntelliJ: Module not found

I'm exploring the modularity of Java 9+ and I'm stuck with adding JavaFX. I'm using IntelliJ and OpenJDK11 but IntelliJ can't seem to find JavaFX even though I have added the library and added the deps in the module-info.
M. Malkon
1

votes
1

answer
193

Views

Using HttpBuilder API in Java 11, where do you specify the hostNameVerifier? [duplicate]

This question already has an answer here: Allow insecure HTTPS connection for Java JDK 11 HttpClient 2 answers We are moving a service from JDK 10.0.1 to JDK 11. This service communicates using a TLS connection, where the server has a self-signed certificate. The CA of this certificate has been add...
Jürgen De Commer
1

votes
0

answer
224

Views

Gradle build comes up with java.lang.NoClassDefFoundError

In a project I am using gradle, Java11, SpringBoot, Junit5. The application is launching without any problem and when I run the unit tests individually everything is fine. However, when I run gradle->build task the following error appears: Task :test FAILED JwtTokenProviderTest > initializationError...
Saeed Afshari
1

votes
0

answer
227

Views

How to diagnose Maven errors after upgrading to Java 11

TLDR: I updated to Java 11 and latest Maven, but Maven is having issues. At first, it does not have enough memory to start the JVM. When the memory is increased >1.5 G, it says it can't allocate the metaspace. Decreasing the memory to 1.2 G or so, it gives a linkage error. What is doing on here? Det...
Zach Boyd
1

votes
0

answer
122

Views

Why do I get “java.io.IOException: Server is not trusted” when try to send email after I switched to Java 11?

I just switched to Java 11 from Java 10 and start getting below exception when I try to send an email: javax.mail.MessagingException: Could not convert socket to TLS at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2155) ~[xxx-0.40.0-SNAPSHOT.jar:?] at com.sun.mail.smtp.SMTPTransport.p...
Dmitriy Dumanskiy
1

votes
0

answer
228

Views

Annotation processor discovery process since Java 9

I am building a Java 11 application with Maven. I have a modularized annotation processor as a dependency and I want it to be discovered and run by javac, but I cannot make it work as expected. (Or maybe my expectations are wrong?) I have provides Processor with ... in my module-info file, and don't...
YaaZ
1

votes
0

answer
455

Views

Gradle Migration to Java 11

In the Gradle build file below the fileTree dependency is loading some local jars, but compilation fails with errors like 'package groovy.text is declared in the unnamed module, but module groovy.text does not read it'. I am not sure where the problem reside, could it be that I have to add also some...
dprutean
1

votes
1

answer
206

Views

Spring data repositories not working after enabling Spring AOP [JAVA 11]

Hi I have an application using Spring 5, Spring Data and Spring AOP and Java 11 (I am using JAVA 9 module system as well). My spring-context/spring-aspects version is 5.1.2.RELEASE Spring Data version is 2.1.2.RELEASE Both the versions are the latest available. I have created repositories in followi...
Abhisar
1

votes
2

answer
229

Views

Spring Boot 2.1.0 Web app and Java 11 fail to maven clean install

The following web app fail to maven clean install: https://github.com/cassiusvm/sfg-pet-clinic The error is below: [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/cassius/git/sfg-pet-clinic/pet-clinic-web/src/main/java/guru/springframew...
cviniciusm
1

votes
1

answer
1.2k

Views

Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application JDK 11

I am stuck at a very basic problem. I have created a simple hello world program using JavaFX which works fine on JDK 1.8. But when I switch to JDK-11 it throws following exception: Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application...
Shahrukh S.
1

votes
0

answer
43

Views

Jigsaw: Bundling JRE with Automatic Modules

Is there a way to bundle the JRE with jlink if not all or even none of the application's dependencies are yet modularized? I do understand that this does not lead to trimmed runtimes but still, I want to bundle a JRE with my application, even untrimmed.
Hannes
1

votes
1

answer
422

Views

Getting java.lang.Exception: Method xxx should have no parameters with jmockit:1.20, junit:4.12 with JDK11

I am using jmockit:1.20, junit:4.12 with JDK11. Earlier it was workign with Java 8 but now its not. The test class is: import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; import mockit.Deencapsulation; im...
Ravi
1

votes
1

answer
377

Views

spring with jlink, moditect and java 11

thanks to pupeno for his precedent work on spring and moditect that helped me for most of my problem on the subject, however I'm blocked a bit further that he was. my problem is the illegal access exception my poc is available on github I used to add this bit of code to make it work with intelliJ ID...
yboompook
1

votes
0

answer
101

Views

Difficulties trying to use a jmod file

I'm using JDK 11 on Windows. I realized a modular JAR file, Uti.jar (into the directory dirLib), containing some classes in a single package, say pkg. Then I realized a simple client, say app.Maine, not a module, with a main method (a console app), which uses a class contained in Uti.jar, say pkg.My...
Virgilio Ravagli
1

votes
1

answer
157

Views

Java 11 gives Unsupported handshake message: server_hello_done on HTTPS connection with client certificate

We have a Java applet (running under tomcat) which makes calls to third parties. One of them uses a client certificate to authenticate. This was working under Java 8, but we recently upgraded the system to Java 11 and it doesn't any more. The error is Unsupported handshake message: server_he...
Adam
1

votes
0

answer
45

Views

Java AWT - The rectangle2d object's width differs in Java8 vs Java11

One of my projects is to migrate from Java8 to Java11. I have a TextLayout object. I am trying to get a Rectangle2D object using textLayout.getBounds(). One strange thing I observe is that the width of the Rectangle2D object is different in Java11 from that of Java8. How is this possible? My Code:...
Abhijith Gururaj
1

votes
1

answer
118

Views

AccessControlException on starting elastic search 5.0.1 with Java 11

I am getting below exception when storing indexes from elastic search 5.0.1 to NFS partition with Java 11. Stacktrace from elastic search logs: java.security.AccessControlException: access denied ('java.io.FilePermission' '/globalSearchElkData/nodes/0' 'write') at java.base/java.security.AccessContr...
Lokesh Agrawal
1

votes
0

answer
77

Views

How to improve gradle.build file?

I'm not an experienced in Gradle or Groovy thus I would like to ask for some help and advice on how to improve my configuration. Introduction: I have a Spring Boot 2 RESTful web server that I want to Dockerize. Here is my Dockerfile: FROM openjdk:11-jre-slim VOLUME /tmp EXPOSE ${SERVER_PORT} ARG JAR...
Pavel
1

votes
1

answer
54

Views

Couldnt read app configuration in PCF from bitbucket after upgrading spring & java versions

Pivotal Spring cloud config service doesnt work with Java 11 and spring boot 2.1.1.RELEASE and spring web: 5.1.3.RELEASE. I am getting 'Error requesting access token'. Any pointers to resolve this issue?
Minisha
1

votes
0

answer
194

Views

Ignore -Xbootclasspath/p command line flag with Java 11+

Is there a way to ignore the -Xbootclasspath/p flag inside the java command line with Java 11 withoiut removing it such that the same command line can be used for Java 8 and Java 11? The command line I am using is the following with ALPN. java -Xbootclasspath/p:/.m2/repository/org/mortbay/jetty/alpn...
Nicolas Henneaux
1

votes
0

answer
147

Views

Upgrading Spring 4 to 5.1.3 with JAVA 11 generate runtime errors

While upgrading Spring to 1.5.3 with JAVA 11, I got run-time exceptions as, Caused by: org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular p...
minu
1

votes
0

answer
307

Views

Java FX classes cannot be resolved to types with Eclipse 2018-12 and JDK 11.02

I've recently upgraded from JDK 10 to JDK 11 and installed the latest Eclipse IDE for Java developers, at verison 2018-12 (4.10.0). However for some reason my old Java FX projects (that worked with JDK 10) are not working. It says that the classes cannot be resolved. The image below shows the red li...
GR412
1

votes
1

answer
249

Views

Upgrade Spring Boot app (using javax.persistence) to JDK 11

I'm in the process of converting a JDK 8 app over to JDK 11. It builds using Gradle and uses JPA/Hibernate under the hood. I've upgraded the necessary Gradle modules, Spring Boot is now 2.1 and it's using the Gradle 5.1 wrapper. It uses QueryDSL JPA annotation processing to build the Q* classes o...
Mike Melusky
3

votes
1

answer
2.5k

Views

How to open JavaFX .jar file with JDK 11?

I created a JavaFX project in IntelliJ. I can run project in IntelliJ. I added below code in Configurations): --module-path ${PATH_TO_FX} --add-modules=javafx.controls,javafx.fxml But the output .jar file of project (made with Artifects) doesn't run. I tested these commands, but didn't get any chanc...
Doctor Henry
1

votes
0

answer
60

Views

How do you mock a singleton dependency in JMockit?

I'm working on some automated unit and integration tests for a robot. As you could imagine, a robot has a lot of sensor objects and such that would need mocking during testing. One of the dependencies is a singleton designed not to be instantiated by anything but itself. As I understood it (I'm new...
Kyle Anderson
1

votes
1

answer
118

Views

CircleCI Java 11 build fail

I have a small spring boot rest api. It was built in java 8, recently I switched to java 11 and have the following problem. It builds localy and works fine, but it can not build on circleci.com. It can not find tools.jar, because it isn't part of jdk since version 9. How can I find the dependency th...
Dragoslav Petrovic
1

votes
0

answer
440

Views

Setting up JavaFX with JDK 11 and Netbeans 10.0

So I'm implementing a Google Maps API and in order to do so I must update my JDK platform. I am currently using NetBeans 10.0 and have got all the appropriate downloads. However it is not connecting with the JavaFX platform. I already have created a JavaFX project on NetBeans 9.0 but I am trying to...
Franklin Memet
1

votes
0

answer
85

Views

Migration Jave 11 _ How to resolve : java.lang.ClassNotFoundException: javax.activation.MimeTypeParseException

I'm migrating my java project from 8 to 11 version. As javax.activation has been removed from JDK 11, so I added it to Maven pom.xml file : javax.activation activation 1.1.1 The dependency is listed in 'Externat librairies' but every time I run 'mvn clean install' to build my project, I get this err...
Mohamed

View additional questions