Java 9 deprecated six modules that contain Java EE APIs and they are going to be removed soon: java.activation with javax.activation package java.corba with javax.activity, javax.rmi, javax.rmi.CORBA, and org.omg.* packages java.transaction with javax.transaction package java.xml.bind with all javax.xml.bind.* packages java.xml.ws with javax.jws, javax.jws.soap, javax.xml.soap, and all javax.xml.ws.* packages java.xml.ws.annotation with javax.annotation package Which maintained third-party artifacts provide those APIs? It
Tag: java-9
JAVA ERROR : package com.sun.rowset is not visible : com.sun.rowset is declared in module java.sql.rowset, which does not export it
I’m simply try to run this code: When I run it I get: Error:(1, 15) java: package com.sun.rowset is not visible (package com.sun.rowset is declared in module java.sql.rowset, which does not export it) I’m using IntelliJ and I tried to import rs2xml.jar, and that still doesnt help. Answer As of Java 9, you can not access this class directly. And
How to quit the JShell and go back to the command-line?
When using the JShell, how do I exit it back to the CMD line? I have already tried ctrl + x and just writing quit, but to no joy. Answer You can use the JShell command to exit as: Side note: Interestingly, with the use of command abbreviations for input shortcuts:- (of course /exi) also, resolves into the same command.
Error: log4j-api-2.9.0.jar is a multi-release jar file but –multi-release option is not set
Exploring the maven-jdeps-plugin:3.1.0 with Java9 using the following minimal pom.xml:- On executing I end up getting a detailed error that reads the following:- I couldn’t find much relevance related to –multi-release flag in either jdeps:jdkinternals goal detailed on Maven’s official site or even in the jdeps tool documented at Oracle help center. Can someone throw some light on this implementation
What does “Required filename-based automodules detected.” warning mean?
In my multi-module project, I created module-info.java only for few modules. And during compilation with maven-compiler-plugin:3.7.0 I’m getting next warning: [WARNING] * Required filename-based automodules detected. Please don’t publish this project to a public artifact repository! * What does it mean? Is that because I have only a few modules with module-info.java and not the whole project? Answer Automatic module
Classloaders hierarchy in Java 9
As of Java 8, I know the hierarchy of the classloaders has been as follows: Bootstrap classloader → Extension classloader → Application classloader What is the change in the hierarchy of classloaders in Java 9 and how does it work? Answer The ClassLoader as revised in Java-9 states that: The Java run-time has the following built-in class loaders: Bootstrap class
How to extract the file jre-9/lib/modules?
In JRE-9/lib directory (at least on Windows), there is a new file called modules whose size is about 107 MB. Is it possible to extract that file or maybe list java modules within it? I can see that a new tool called jmod is available at jdk-9/bin/jmod.exe, but that is for reading .jmod files which is located at jdk-9/jmods and
Observer is deprecated in Java 9. What should we use instead of it?
Java 9 came out, and Observer has been deprecated. Why is that? Does it mean that we shouldn’t implement observer pattern anymore? It would be good to know what is a better alternative? Answer Why is that? Does it mean that we shouldn’t implement observer pattern anymore? Answering the latter part first – YES, it does mean you shouldn’t implement
Is it possible to mix –class-path and –module-path in javac (JDK 9)?
When I compile a module that depends on other modules I’ve compiled previously I have to specify the –module-path <directory> option. This makes modules I depend on visible. But at the same time I would also like to make some non-modular Jar files visible. However if don’t make them automatic modules and just specify the –class-path some.jar right next to
Where to place module-info.java using Java 9?
I have an OSGI application and I have around 30 bundles (jar files). Today I decided to see how it works/if it works with Java 9. So I started my application and got After some reading I added command line option and created file module-info.java with the following content: And I have two questions. Where should I place this module-info.java