jigsaw

Create Java runtime image on one platform for another using Jlink

随声附和 提交于 2019-11-26 16:08:12
问题 I created runtime image using jlink on my Linux machine. And I see linux folder under the include folder. Does it mean that I can use this runtime image only for Linux platform? If yes, are there any ways to create runtime images on one platform for another (e.g. on Linux for Windows and vice versa) 回答1: The include directory is for header files, such as jni.h , that are needed when compiling C/C++ code that uses JNI and other native interfaces. It's nothing to do with jlink . The jlink tool

How to express dependency in maven on java ee features for transition to Java 9?

[亡魂溺海] 提交于 2019-11-26 14:43:01
We use maven and have artifacts that in turn depend on other internal artifacts. I am in the process of migrating to java-9 , and intend to migrate everything to Java 9 first without modularizing the code (i.e. in the unnamed module). The problem I run into is that we depend on java.xml.bind , which is now not included in the default modules. Is there a "correct" way to express this dependency on java.xml.bind with Maven? The Module System speaks of the way the unnamed modules as in your case of loading the application from classpath constructs the module graph. Further, from the documentation

Package conflicts with automatic modules in Java 9

北城余情 提交于 2019-11-26 14:40:27
With Java 9 on the close horizon I thought it would be a good learning exercise to port some of my projects over to Java 9. In one of my projects I have dependencies for rxjava and rxjavafx dependencies { compile 'io.reactivex:rxjava:1.2.6' compile 'io.reactivex:rxjavafx:1.0.0' ... } I want to create this project as a named-module. To do this I need to create a module-info.java file and I need to specify the requirements for rxjava and rxjavafx here. However, these libs don't have any module info yet. In order to work around this I've read that I need to create Automatic Modules . From what I

How to use 3rd party library in Java9 module?

有些话、适合烂在心里 提交于 2019-11-26 14:08:22
问题 I have some java9 module that uses 3rd party library that is not Java9 module, just a simple utility jar. However, the compiler complains that it can't find a package from my utility. What should I do in module-info.java to enable usage of my 3rd party library? 回答1: You can use your library as an automatic module . An automatic module is a module that doesn't have a module descriptor (i.e. module-info.class ). But what name should you use to refer to this module? The name of the automatic

What is an automatic module?

北战南征 提交于 2019-11-26 11:12:42
问题 Automatic modules are mentioned many times on stackoverflow but I couldn\'t find a complete, succinct and self-sufficient definition of an automatic module. So, what is an automatic module? Does it export all packages? Does it open all packages? Does it read all other modules? 回答1: I first answer your actual question ("What is an automatic module?"), but I also explain what they are there for . It is hard to understand why automatic modules behave the way they do without that information.

阿里巴巴微服务架构演进

折月煮酒 提交于 2019-11-26 10:15:40
阿里巴巴服务化架构演进 单一应用架构 All In One 整个网站几个应用 前台 web + 后台 ops + tasks 业务 web + service/dao 各自开发 一起集成发布 技术战:Webx、Spring Ibatis、Jboss、Oracle 存在的问题:合并时经常代码冲突、发布相互制约效率低下、应用代码庞大臃肿维护困难。 垂直应用架构 按应用拆分 Service / DAO / Impl 都以二方库 jar 包的形式提供出去 代码拆分,独立部署,流程隔离,技术栈没有太大变化 应用相互之间直接依赖二方库 问题: 升级困难,要全网推动 数据库连接池压力大 分布式服务架构 API 与实现分离 使用 RPC 进行通信,服务端升级方便 各种服务中心出现,会员中心,商品中心,交易中心等 技术栈: Ali-tomcat Pandora Dubbo HSF 存在的问题: 依赖冲突 中间件升级困难 应用配置服务 应用开发效率低下 微服务架构 拥抱微服务,提升开发体验和效率 应用更轻量、开发更简单 配置 编码 开发 调试 部署 技术栈: Pandora Boot Spring Boot 容器隔离Pandora 为什么需要隔离? Pandora的容器架构如下: Pandora 结构与部署形式: 与应用 tgz 包部署在一起 应用可单独升级 pandora.sar 应用容器识别

Accessing resource files from external modules

风格不统一 提交于 2019-11-26 08:28:58
问题 So far until non-modularized java, you would simply put a file in src/main/java/resources make sure it is in classpath and then load it with file = getClass().getClassLoader().getResourceAsStream(\"myfilename\"); from pretty much anywhere in the classpath. Now with modules, the plot thickens. My project setup is the following: module playground.api { requires java.base; requires java.logging; requires framework.core; } Config file is placed inside src/main/resources/config.yml . Project is

Scanning classpath/modulepath in runtime in Java 9

元气小坏坏 提交于 2019-11-26 06:40:21
问题 I can\'t seem to find any info on whether scanning all available classes (for interfaces, annotations etc) is still possible in runtime, the way Spring, Reflections and many other frameworks and libraries currently do, in the face of Jigsaw related changes to the way classes are loaded. EDIT : This question is about scanning the real physical file paths looking for classes. The other question is about dynamically loading classes and resources. It\'s related but very much not a duplicate .

How to express dependency in maven on java ee features for transition to Java 9?

有些话、适合烂在心里 提交于 2019-11-26 03:59:41
问题 We use maven and have artifacts that in turn depend on other internal artifacts. I am in the process of migrating to java-9, and intend to migrate everything to Java 9 first without modularizing the code (i.e. in the unnamed module). The problem I run into is that we depend on java.xml.bind , which is now not included in the default modules. Is there a \"correct\" way to express this dependency on java.xml.bind with Maven? 回答1: The Module System speaks of the way the unnamed modules as in

Package conflicts with automatic modules in Java 9

青春壹個敷衍的年華 提交于 2019-11-26 02:58:33
问题 With Java 9 on the close horizon I thought it would be a good learning exercise to port some of my projects over to Java 9. In one of my projects I have dependencies for rxjava and rxjavafx dependencies { compile \'io.reactivex:rxjava:1.2.6\' compile \'io.reactivex:rxjavafx:1.0.0\' ... } I want to create this project as a named-module. To do this I need to create a module-info.java file and I need to specify the requirements for rxjava and rxjavafx here. However, these libs don\'t have any