module-path

Automatic modules not found in Eclipse 2018-12 when project is opened

淺唱寂寞╮ 提交于 2019-12-10 21:46:18
问题 I want to switch from Oracle JDK 8 to Open JDK 11 using Eclipse 2018-12. I have the following situation: In my Eclipse workspace I have a main maven project called example with some maven dependencies my_dependency_1, my_dependency_2 that are also maven projects in the same workspace. Currently, only example is modular (and thus contains a module-info.java ). The other projects are non-modular and are included in the pom.xml as well as required (automatic) modules in the module-info.java of

fatal error compiling invalid flag --module-path

柔情痞子 提交于 2019-12-09 15:54:29
问题 I have a project. Originally it was a single module project with structure like this java-cloud-sample\ src\ main\ java pom.xml I decided to make it into a multi-module structure - I use java 9 anyway. So I separated it like this java-cloud-sample\ java-cloud-rest-api\ src\ pom.xml pom.xml Where root pom.xml looks like this <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:/

Is there a way to modify module path and added modules of a programmatic JShell instance?

ⅰ亾dé卋堺 提交于 2019-12-07 04:24:46
问题 I'm trying to run some Java code at run-time through a JShell instance I created using the JShell API. To demonstrate my problem, I'm going to share my simple code. With my current setup I have a directory called lib that has the MySQL Java driver: mysql-connector-java-5.1.35.jar . Launching JShell via command tool and adding the needed module as: jshell --module-path lib --add-modules mysql.connector.java and then loading the mysql driver works for me : jshell> Class.forName("com.mysql.jdbc

How do I add modules to the Eclipse Oxygen module path for a project?

故事扮演 提交于 2019-12-01 06:30:31
问题 I have a project that today has several jars as "Referenced Libraries". I'd instead like to add these as automatic modules on the module path so I can require them in my module-info.java. How do you add jars to the module path in Eclipse Oxygen? 回答1: Here is how I got it to work (first few steps are for those that haven't set up Eclipse for JDK 9 usage yet): Install JDK 9 (9.0.1 was available at this time from Oracle). Configure Eclipse to run with JDK 9 by modifying eclipse.ini by adding

Add a custom JMOD to the module path with Java 9

我的梦境 提交于 2019-11-29 09:33:32
问题 I created a simple JMOD file with the jmod tool like this $JAVA_HOME/bin/jmod create --class-path classes test/samples.jmod Next, I tried to execute a class within that module by running: java -mp test -m de.mypackage/de.mypackage.Test Which resulted in the following exception: Error occurred during initialization of VM java.lang.module.ResolutionException: JMOD files not supported: test/samples.jmod at java.lang.module.Resolver.findWithBeforeFinder(java.base@9-ea/Resolver.java:729) at java

In Eclipse, what is the difference between modulepath and classpath?

ε祈祈猫儿з 提交于 2019-11-27 21:57:53
In Eclipse, what is the difference between modulepath and classpath, and which one should I use to add a jar in the lib folder? And why does the JRE System Library appear in modulepath? The module system has mainly the following impact on the code: A package can only be accessed from one module (Nested packages are treated as separate, so even though the package java.util is in the module java.base , the package java.util.logging can be in the module java.logging ) You can only access public fields and methods of code in exported packages of other modules. This is true even with reflection (i

In Eclipse, what is the difference between modulepath and classpath?

牧云@^-^@ 提交于 2019-11-26 22:54:36
问题 In Eclipse, what is the difference between modulepath and classpath, and which one should I use to add a jar in the lib folder? And why does the JRE System Library appear in modulepath? 回答1: The module system has mainly the following impact on the code: A package can only be accessed from one module (Nested packages are treated as separate, so even though the package java.util is in the module java.base , the package java.util.logging can be in the module java.logging ) You can only access

Is it possible to mix --class-path and --module-path in javac (JDK 9)?

本小妞迷上赌 提交于 2019-11-26 12:19:27
问题 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 automatic modules and just specify the --class-path some.jar right next to --module-path <directory> , then javac seems to ignore the claspath and throws \"package yyy not found\" and other \"not found\" errors