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
0
votes
0 answers

Unable to create an EntityManager object in a Spring example

I am learning about the Spring framework by adopting a found example. The example instantiates an EntityManager object as follows: package com.example.demo; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import…
Sae1962
  • 1,122
  • 15
  • 31
0
votes
0 answers

Project maven-builds fine, but when I create module-info.java, I get "The forked VM terminated without properly saying goodbye."

I have a simple project which uses maven, spring-boot, and connects to a postresql-Database. When I run mvn clean install, everything runs fine, even the tests. (I am compiling it with java 10) Then I add a module-info.java to turn it into a java9…
MJL
  • 352
  • 3
  • 11
0
votes
0 answers

How to keep module-info.java up to date

Is there anyway to find out what your module requires? After writing a basic microservice it took some tinkering to work out what I needed to add to my module-info.java. It was a simple application with a hardcoded endpoint; it seemed rather painful…
myguy1221
  • 261
  • 1
  • 5
  • 14
0
votes
1 answer

How to enforce module boundaries in Java <= 8

I want to modularize a monolithic application by using Java modules (introduced by Project Jigsaw). Unfortunately I'm currently stuck to use Java 8. I would like to build those modules (jar files) anyway, but without the feature of using a…
Oliver
  • 353
  • 1
  • 4
  • 16
0
votes
0 answers

JPMS/Jigsaw-compatible Java library targeting older JDKs

I'm trying to figure out how to use Maven to build a library jar file that is compatible with JDK 7 and 8 but includes a module-info.java file an explicitly declares its public API. Problem: I need to compile for old target versions but the old JDKs…
0
votes
0 answers

Require akka in module-info.java

What do I have to require in module-info.java to use Akka with JDK 9? I have following dependency in maven. com.typesafe.akka akka-actor_2.12 2.5.6
carpenter
  • 251
  • 2
  • 11
-1
votes
1 answer

Problems with Git, Intellij, and module-info.java

So I'm working on a group Java 14 project right now and something appears to have gone wrong in my code in terms of building and executing. I switched over from Eclipse a while back due to difficulties with the way it handled Git, and have been…
Appellus
  • 7
  • 1
1 2 3
10
11