java-9

What else am I missing to load service providers using the new Java module system?

三世轮回 提交于 2019-12-10 10:07:14
问题 I'm adding module-info.java s to Ikonli packages and I'm running into trouble with their service classes. ikonli-core defines an interface called IkonHandler. ikonli-fontawesome5-pack has a service provider for the IkonHandler called FontAwesomeSolidIkonHandler. These service prodivers are used by ikonli-javafx 's IkonResolver. Given this, I created these module definitions: module org.kordamp.ikonli.core { exports org.kordamp.ikonli; } module org.kordamp.ikonli.javafx { exports org.kordamp

compile tests using maven-compiler and jdk9-ea+148

醉酒当歌 提交于 2019-12-10 07:06:13
问题 I have problem with building my application using maven-compile-plugin:3.6.0 at jdk9-ea+148. I am trying to make jdk9 module. Module-info and other classes are getting compiled without problem, but when it comes to default-testCompile it just crashes. When my module-info.java is removed, the it is compiled without problems. Basically this is the exception I am getting: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project bar:

Debugging with JShell

那年仲夏 提交于 2019-12-10 03:51:02
问题 I write a Java method in JShell and now I want to debug it. I would like to set breakpoints or at least step through an execution line-by-line. Does JShell have these debugging abilities? 回答1: Just to clarify further, from the JEP: The Java Shell (Read-Eval-Print Loop) itself, the Non-Goals states : Out of scope are graphical interfaces and debugger support . The JShell API is intended to allow JShell functionality in IDEs and other tools, but the jshell tool is not intended to be an IDE .

Why and how do you use JShell?

与世无争的帅哥 提交于 2019-12-10 03:45:56
问题 I went through a couple of tutorials for JShell and I still do not understand the most important part: why would I even use JShell? Here what Oracle says: "You can test individual statements, try out different variations of a method, and experiment with unfamiliar APIs within the JShell session". Yes, great, but for all those things I can just use an IDE. I do understand, that REPL should make code evaluation faster. However, testing a snippet of code in IDE in a dummy Hello World project

Java 9 modules and classpath hell: conflicting class names

ぃ、小莉子 提交于 2019-12-10 03:42:01
问题 It is said that java 9 modules will solve classpath hell. However, I am thinking about the following situation: Module A uses modules B and C. Both modules will export a class with same name and package. How will the classloading issue be solved here? 回答1: This situation is forbidden in the Java 9 module system. If two modules in the same layer have the same package, Java 9 will fail at startup with an error: java.lang.LayerInstantiationException: Package <package_name> in both module

IntelliJ doesn't Understand java libraries on Java9-ea

混江龙づ霸主 提交于 2019-12-10 03:01:16
问题 I am using jdk9-ea 149 and created a sample javafx application IntelliJ doesn't understand the java libraries, It's shows all the import statement in red color and they are all grayed out .even for java.util.List, java.util.ArrayList it has the same issue. I am able to compile form outside but i am not able to compile the code from IntelliJ 2016.3.2 Ultimate Edition . It looks like we need to add some libraries to IntelliJ project but with java9 build 149 jigsaw i don't know how to do that. I

Does SonarQube support Java9?

拈花ヽ惹草 提交于 2019-12-10 02:35:06
问题 The question is actually twofold: Can Java9 projects be analysed with SonarQube? Can SonarQube itself run on a Java9 JVM? Same question for Java8 回答1: TL;DR: YES!!! It supports analysis, apparently since 3rd July 2017 (But they are desperately trying to hide the fact...) As of now (2017-10-24, SonarQube version 6.6), SonarQube can analyse Java9 code using SonarJava 4.11 or newer, but running on a Java9 JVM is not officially supported . SonarQube Java Plugin compatibility The SonarJava page

Can the Java 9 jshell be used to run code in another JVM?

你离开我真会死。 提交于 2019-12-10 02:04:25
问题 Java 9 has a read-eval-print loop for Java, called jshell . I've seen it work in it's basic mode, from the command line. Can it also be used in a remote process? In other words, can I connect to another Java process and enter code snippets to run within that runtime? This would be a nice way to change configuration state in an app server without having to write an admin tool with a UI. 回答1: The simple answer is no, there is no way to attach jshell to a running Java process. jshell is a

Java 9 Nested (Hierarchical or Parent/Child) Modules

随声附和 提交于 2019-12-10 00:06:14
问题 Is it possible to create inheritance-based (or nested) modules in Java 9? Something like this: module a | ├── module a1 | └── module a2 In this example, both the a1 and a2 modules are children of a . If I import either of the child modules, I would get the functionality of the parent ( a ) along with any functionality defined in that child. That is, I could import a1 , and explicitly gain access to the functionality of both a and a1 (but not a2 ). Both a1 and a2 are an a , and can access all

Failed to execute maven-compiler-plugin:3.6.1:testCompile when using java 9

最后都变了- 提交于 2019-12-09 17:17:57
问题 I know that there are a lot question with similar error. I would appreciate before point as duplicate take in account that it only happens with Java 9. I do have java 9 installed C:\_pocs\ws_j9\java9-http-client>java -version java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode) C:\_pocs\ws_j9\java9-http-client>echo %JAVA_HOME% C:\Program Files\Java\jdk-9.0.1 To make simple the exemplification, if i download a very