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.…
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 Jav…
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 sam…
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 …
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…
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…
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 …
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…
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 au…
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 sho…