java-9

Eclipse/java9-jigsaw: how to access javafx packages?

泄露秘密 提交于 2020-01-02 09:13:02
问题 My context: 9-ea-113 (that is javafx now fully modularized, without jfrt.jar) eclipse-neon-M6 with the current beta support for java9 (running on java8, if that matters) win7 Something simple like import javafx.application.Application; public class FirstApplication extends Application { // } doesn't compile because the javafx.xx packages are not found. What to do? 回答1: Edit the .classpath file of the project and add the entry below - seems to work. <classpathentry kind="con" path="org.eclipse

Java 9 dependency issues regarding serviceloader

泪湿孤枕 提交于 2020-01-02 09:10:51
问题 I have a question about how the serviceloader changed in Java 9 based on this scenario Scenario Project gert Class Main package gert; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; public class Main { static public void test() throws JAXBException { InputStream is = new ByteArrayInputStream("<Classes RUNTIME_INCLUDE_JARS=\"\">

transitive dependencies in Eclipse Plugin-Project with Java 9

拈花ヽ惹草 提交于 2020-01-02 06:54:05
问题 It seems, that in my Eclipse Oxygen 3 transitive dependencies are not resolved in Plugin-Projects. Consider the following Project with A depending solely on B, and B depending on C: While running A in JDK 1.8 turns out fine (as expected), in JDK 9 I get the well known Exception in thread "main" java.lang.NoClassDefFoundError: c/C at b.B.<init>(B.java:9) at a.A.main(A.java:8) Caused by: java.lang.ClassNotFoundException: c.C at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass

How to suppress the “requires transitive directive for an automatic module” warning properly?

Deadly 提交于 2020-01-02 02:23:06
问题 After upgrading a Maven project to Java 9 and adding a module descriptor, javac complains about a transitive dependency for an automatic module: [WARNING] /.../src/main/java/module-info.java:[3,35] requires transitive directive for an automatic module An example module-info.java to reproduce the problem: module com.example.mymodule { exports com.example.mymodule.myexportedpackage; requires transitive com.google.common; } The meaning of this warning is completely clear, here are some related

How to suppress the “requires transitive directive for an automatic module” warning properly?

断了今生、忘了曾经 提交于 2020-01-02 02:23:02
问题 After upgrading a Maven project to Java 9 and adding a module descriptor, javac complains about a transitive dependency for an automatic module: [WARNING] /.../src/main/java/module-info.java:[3,35] requires transitive directive for an automatic module An example module-info.java to reproduce the problem: module com.example.mymodule { exports com.example.mymodule.myexportedpackage; requires transitive com.google.common; } The meaning of this warning is completely clear, here are some related

Groovy Java 9 modules support

情到浓时终转凉″ 提交于 2020-01-02 00:53:05
问题 I've spent some time to migrate my project written in Groovy to Java 10. Now it's possible to compile and run it. But still it doesn't use any benefits of Java 9 modularity. Googling about Groovy and Java 9 modules gives almost nothing. So is it possible to migrate Groovy project to use JDK 10 with Project Jigsaw modules? 回答1: Well, after a few days of experiments I come up with the answer - yes, it is possible to use Groovy with Project Jigsaw modules. But it needs some additional effort.

Eclipse Mars Support for Java9 - Build path settings

懵懂的女人 提交于 2020-01-01 13:34:07
问题 I tried to install and use the Java 9 support for Eclipse Mars. However when trying to compile a simple Hello World program I get two errors in Eclipse: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files Main.java /Java9Test/src line 1 Java Problem The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project Java9Test Unknown Java Problem

How will JDK9 modules help for 'package-scoped sub-packages'?

依然范特西╮ 提交于 2020-01-01 10:57:03
问题 I am wondering about JDK9 modules. Say you have the following 3 packages: com.company.product com.company.product.impl_a com.company.product.impl_b Classes in package product.impl_a and product.impl_b can only be accessed by classes in package product . The user should only use classes from product package. You can imagine that passing certain flags or properties will decide whether impl_a or impl_b will be used, internally. In JDK8-, you have to make these classes inside impl_a and impl_b

Java 9 ServiceLoader runtime module loading and replacement

不羁岁月 提交于 2020-01-01 10:53:28
问题 I just read about Java 9 module system and I'd like to ask about ServiceLoader. Is there any way how to add service implementation when the application is already started? How about removing some service implementation? Use case: I will have some application that calculates something. The calculation algorithm will be defined in some service(Java 9 module). Are there any steps that can be done to replace this algorithm without stopping the application? When will I replace the jars is it just

Java 9 ServiceLoader runtime module loading and replacement

不打扰是莪最后的温柔 提交于 2020-01-01 10:51:14
问题 I just read about Java 9 module system and I'd like to ask about ServiceLoader. Is there any way how to add service implementation when the application is already started? How about removing some service implementation? Use case: I will have some application that calculates something. The calculation algorithm will be defined in some service(Java 9 module). Are there any steps that can be done to replace this algorithm without stopping the application? When will I replace the jars is it just