Questions tagged [module-info]

Used for module-info.class related queries used for module declaration in Java since its Java 9 release. This would mostly be coupled with java-9 or above tag.

The State of the Module System defines module declarations as:

A module’s self-description is expressed in its module declaration, a new construct of the Java programming language.

The simplest possible module declaration merely specifies the name of its module:

module com.foo.bar { }

The source code for a module declaration is, by convention, placed in a file named module-info.java at the root of the module’s source-file hierarchy. The source files for the com.foo.bar module, e.g., might include:

module-info.java
com/foo/bar/alpha/AlphaFactory.java
com/foo/bar/alpha/Alpha.java
...

A module’s declaration does not include a version string, nor constraints upon the version strings of the modules upon which it depends. This is intentional: It is not a goal of the module system to solve the version-selection problem, which is best left to build tools and container applications.

Module declarations are part of the Java programming language, rather than a language or notation of their own, for several reasons

157 questions
1
vote
1 answer

Running javafx application - Error occurred during initialization of boot layer: java.lang.module.ResolutionException

As the title says, I'm just trying to run the javafx application. However I have no idea why I'm getting this error, and I don't know why the error is referencing the sisu.inject.bean and aopalliance modules. I don't know wether the module-info.java…
1
vote
2 answers

How to set mainClassName in Gradle 6.6 with modular Java

In Gradle 6.3 within build.gradle, mainClassName may be set like this with no complaints: mainClassName = 'mod/app.Main' In Gradle 6.61, the above line results in this: java.lang.module.InvalidModuleDescriptorException: Package mod.app not found…
Jack J
  • 1,514
  • 3
  • 20
  • 28
1
vote
0 answers

Getting automatic module error when using jlink with the org.json:json artifact

I'm creating a JavaFX project for the first time, and I'm having a bit of trouble with exporting and deploying the project. Following this tutorial, I tried using jlink, but ran into an error: Error: automatic module cannot be used with jlink: json…
1
vote
1 answer

Automatic Module cannot be found

I cannot import org.json as an Automatic Module. I've set up a very simple test project with the following directory structure: src\module-info.java src\uk\co\stikman\broken\Example.java lib\json-20200518.jar module-info: module…
Stik
  • 519
  • 4
  • 17
1
vote
1 answer

How to merge two automatic modules exporting the same package in Project Jigsaw?

The concept guide of Project Jigsaw introduces "a bridge between two automatic modules exporting the same package". 1 In fact, currently both of two automatic modules grpc.api and grpc.context export io.grpc package, as is reported in its github.…
1
vote
1 answer

Error with package com.sun.glass.ui while learning Java Native Access

I am trying to use an Undecorated stage in a JavaFX project, stage.initStyle(StageStyle.UNDECORATED);. It is a modular Gradle project. It is also a multi-project build, though because I am working on it in IntelliJ, it might be more appropriate to…
Jack J
  • 1,514
  • 3
  • 20
  • 28
1
vote
1 answer

NullPointerException when changing JavaFX Tab Order

I downloaded and tried the javafx sample "Draggable and detachable tabs in JavaFX 2" by Michael Berry from https://berry120.blogspot.com/2014/01/draggable-and-detachable-tabs-in-javafx.html It works just fine in Java 8, but trying it with Java 11…
1
vote
0 answers

Java 11 module + Weld

I created a simple Java 11 SE maven project with Weld 3.0.5. package main; import javax.enterprise.inject.se.SeContainer; import javax.enterprise.inject.se.SeContainerInitializer; public class Main { public static void main(String[] args){ …
1
vote
1 answer

Make the new JDK 11 java.net.http package visible in Netbeans 10

After opening an existing Netbeans 8 project in Apache Netbeans 10, and setting the Java version to the newest JDK 11, Netbeans is still unable to resolve references to the new java.net.http package which includes improved HTTP handling with classes…
Bobulous
  • 12,967
  • 4
  • 37
  • 68
1
vote
0 answers

Java automatic modules with Maven

Software versions: Apache Maven 3.5.3 Maven home: C:\apache-maven-3.5.3 Java version: 10.0.1, vendor: Oracle Corporation I have Maven dependency when I run mvn compile command in terminal it gives me this error: java/module-info.java:[6,32] module…
Matahari
  • 109
  • 1
  • 3
  • 12
1
vote
1 answer

JHipster Spring Boot modularization split package

I am trying to modularize a JHipster 5 (Spring Boot 2) application and I ran into a split package problem. In module-info.java I have the following conflicting automatic modules: requires problem.spring.web; requires problem; requires…
djeison
  • 490
  • 2
  • 5
  • 20
1
vote
0 answers

Java 9 - how to recompile .jar library with module-info

I read that to add .jar libraries as dependency in java9 modules, we just need to include them in --module-path and they will be converted to 'Atomatic Modules' However when I try to use jLink, I still got the error: Error: module-info.class not…
Tiago Santos
  • 489
  • 5
  • 16
0
votes
0 answers

Eclipse bug with JUnit and 'module-info.java'?

After a combination of Google / Stack Overflow searches I landed on this post which describes my exact problem: StackOverflowQuestion The post defines this issue is an eclipse bug of version '2022-06': my version, as you can see in the 'Details'…
0
votes
0 answers

Unable to redirect to the correct html in Spring Controller @GetMapping -- module-info.java is causing Error resolving template

problem-situation 1. I have a extremely simple Controller package com.redfrog.note; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class BallController { …
Nor.Z
  • 555
  • 1
  • 5
  • 13
0
votes
0 answers

How to add org.jsoup library as module in multimodule project and compile with jlink?

I'm need help with jlink packaging. I have a multi module project and use Maven. Project: -module1; -module2; -module3. Module3 it's JavaFx and depends on module2. Module2 depends on Jsoup library (from maven repository) and I put as dependency in…
mr.ANDREW
  • 51
  • 1
  • 7