jigsaw

How to add org.eclipse.swt (and other plugin dependencies) as an automatic Java9 module?

依然范特西╮ 提交于 2019-11-29 08:13:34
In order to be able to use my Eclipse plugin "treezCore" also as a Java9 module I created a module-info.java in my src folder. Furthermore, I moved the Plug-in Dependencies from the Classpath to the Modulepath. I can see a module "org.eclipse.swt.3.106.1.v20170926" in the plugin dependencies: However, I am not able to reference that module in my module-info.java. I tried require org.eclipse.swt.3.106.1.v20170926; require org.eclipse.swt; require swt; None of those options worked. The jar file \plugins\org.eclipse.swt_3.106.1.v20170926-0519.jar that is used by Eclipse does not contain a module

Run spring boot with jdk9 using jigsaw modules

南楼画角 提交于 2019-11-29 07:12:44
What's wrong with this application. I thought the mix of classpath jars and module jars are valid. For all jars not having an explicit module-info become an automatic module? When I delete my module-info.java it works. Because IDEA using the classpath for this case. Java(TM) SE Runtime Environment (build 9+176) IntelliJ IDEA 2017.1.4 module-info.java module test { requires spring.boot.autoconfigure; requires spring.boot; } App.java package com.foo.test; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication

Unable to export a package from java.base module

一笑奈何 提交于 2019-11-29 02:35:15
问题 Using IDEA-EAP for JDK9 development experiments. I am getting the following error - Error:(3, 20) java: package jdk.internal.misc is not visible (package jdk.internal.misc is declared in module java.base, which does not export it to module com.jigsaw.npe) The class definition is as - package experiment; import jdk.internal.misc.Unsafe; public class CompareAndSwap { static Unsafe UNSAFE = Unsafe.getUnsafe(); ... } I've tried including a module-info.java file as well inside the module created

How does the Javadoc deal with the visibility of modules in Java 9?

泄露秘密 提交于 2019-11-29 02:31:41
问题 The Javadoc tool generates documentation based on the accessibility modifier. By default, it document all public and protected classes, fields and methods. This can be changed with the following options: -public Shows only public classes and members. -protected Shows only protected and public classes and members. This is the default. -package Shows only package, protected, and public classes and members. -private Shows all classes and members. Java 9 introduces the concept of modules, and

JSR-305 annotations replacement for Java 9

雨燕双飞 提交于 2019-11-29 01:51:49
问题 So far we have been using the Findbugs JSR-305 annotations (com.google.code.findbugs:jsr305) and everything including tool support (Sonar, Eclipse, Findbugs, …) has been working fine. However it is our understanding that Jigsaw in Java 9 is going to break JSR-305 annotations (one package in two modules is not allowed). This was confirmed at JavaOne 2015. Oracle's reasoning is JSR-305 never happened and JSR-250 would have to endorse these annotations. We're looking for replacements for JSR-305

类加载机制,双亲委派模型(2)

。_饼干妹妹 提交于 2019-11-28 20:01:16
接着昨天的记录,今天继续开始了。 在JDK9中,由于Jigsaw项目引入了Java平台模块化系统(JPMS),Java SE的源代码被划分为一系列模块。 类加载器,类文件容器等都发生了非常大的变化,API已经被划分到具体的模块中,所以上文中,利用“——Xbootclasspath/p” 替换某个Java核心类型代码,实际上变成了对对应的模块进行的修补,可以采用下面的解决方案: 首先,确认要修改的类文件已经编译好,并按照对应模块结构存放,然后,给模块打补丁: java --patch-module java.base=your_pathch yourApp 拓展类加载器将被重命名为平台类加载器(Platform Class-Loader),而且extension机制规则被移除。也就意味着,如果我们指定Java.ext.dirs环境变量,或者lib/ext目录存在,JVM将直接返回错误!建议解决方法就是将其放入classpath里。 部分不需要AllPermission的Java基础模块,被降级到平台类加载器中,相应的权限粒度也被更精细粒度地限制起来。 rt.jar和tools.jar同样是被移除了!JDK的核心类库以及相关资源,被存储在jimage文件中,并通过新的JRT文件系统访问,二不是原有的JAR文件系统。虽然看起来很惊人,但幸好对于大部分软件的兼容性影响,其实是有限的

Project Jigsaw vs Maven

假如想象 提交于 2019-11-28 17:23:54
问题 From Jigsaw Project: Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms. I'm trying to learn what project Jigsaw is and till now it seems that the goal of Project Jigsaw somewhat overlaps with what we did using Maven (or Gradle) dependency management: Is it a threat to build tools like Maven? Or my understanding is wrong and project Jigsaw is going to complement these build tools in some way? 回答1: Very simplified

How do you organize tests in a modular Java project?

梦想与她 提交于 2019-11-28 09:21:33
I am creating a modular build (using module-info.java) on GitHub , but when adding a module-info.java to the modules that I want modular, no tests can be executed... How can I achieve this? I am using the following versions: junit.jupiter version 5.3.0 (first take was also unsuccessful with version 5.2.0) maven-compiler-plugin version 3.8.0 (first take was also unsuccessful with version 3.7.0) maven-surefire-plugin version 2.22.0 (first take was also unsuccessful with version 2.21.0) A typical error from the failing tests looks like: java.lang.reflect.InaccessibleObjectException: Unable to

What are the predefined modules in JDK9 or Which module do I need to fix dependency problems?

泄露秘密 提交于 2019-11-28 01:39:01
问题 JDK9 will (probably) introduce a module system. As part of that, the Java Class Library will get modularized. This can lead to exceptions when classes don't get found because they are in a module that isn't specified as a dependency yet. What are the modules that will get created with the module system and what is their respective content? Or stated differently: Given a class that doesn't get loaded, how do I find the proper module to include as a dependency? 回答1: how do I find the proper

Run spring boot with jdk9 using jigsaw modules

痴心易碎 提交于 2019-11-28 00:57:33
问题 What's wrong with this application. I thought the mix of classpath jars and module jars are valid. For all jars not having an explicit module-info become an automatic module? When I delete my module-info.java it works. Because IDEA using the classpath for this case. Java(TM) SE Runtime Environment (build 9+176) IntelliJ IDEA 2017.1.4 module-info.java module test { requires spring.boot.autoconfigure; requires spring.boot; } App.java package com.foo.test; import org.springframework.boot