Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use jigsaw with Java 9

I am trying to experiment with project Jigsaw as per this link http://openjdk.java.net/projects/jigsaw/doc/quickstart.html

However, I cant find jmod command in the Java 9 early access build. Similarly, javac emits an error message saying

javac: invalid flag: -modulepath".

Any idea? What is the best way to experiment with Jigsaw in Java 9?

like image 900
user3239604 Avatar asked Mar 31 '15 10:03

user3239604


People also ask

What is project Jigsaw Java?

Project Jigsaw is an umbrella project with the new features aimed at two aspects: the introduction of module system in the Java language. and its implementation in JDK source and Java runtime.

Where is module-info Java?

The module descriptor ( module-info. java ) needs to be located in the src/main/java directory. Maven will set up javac to use the appropriate module source path.

What is module-info Java?

module-info. java file. It declares the dependencies within the module system and allows the compiler and the runtime to police the boundaries/access violations between the modules in your application.


2 Answers

Although the preparatory JEP 201 and JEP 220 are both present as of JDK 9 build 41, the main Jigsaw work for JSR 376 is not yet present.

In response to a similar question on the mailing list, about that quickstart guide:

This is a quick start documentation from the original Jigsaw prototype of a few years ago, I guess it's a reminder that some of these obsolete pages needs to be updated to make it clear that they are obsolete.

and about the current state of the work:

JSR 376 is just starting and so there isn't a JEP for the module system yet. It will all come in time.

So, as of March 2015, the OpenJDK 9 builds don't include Jigsaw support. The jigsaw-dev mailing list is the best place to look for progress. It also confirms that status:

So too early to be looking for options like -modulepath.

It's likely that Jigsaw-specific builds will be made available ahead of inclusion in the regular JDK 9 builds.

like image 138
Joe Avatar answered Oct 06 '22 04:10

Joe


There are now early access builds available with Jigsaw

like image 25
samael Avatar answered Oct 06 '22 06:10

samael