• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How To: Figure out What is Requiring a Module

 
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to know how to figure out which module or class (of my own) requires a specific module.  I want to be "taught to fish" rather than trying to recreate this issue here and receive (the usual excellent) help from others to solve it.  I want this for a couple of reasons:   first, I suspect this will happen again after I solve this one, and second, this only happened after a lot of big changes -- move from maven to gradle + Java 11 to Java 17--which I think will make it difficult to recreate this bug without the whole codebase.  So, I want to be able to solve this myself if possible.

So, when I see gradle claiming



Or any other module, is there some tool I can use that will tell me what code has that dependency?   Yes, I have seen that jakarta.activation is supposed to have replaced this as of long ago.  I have that dependency in place.

Thanks
 
Saloon Keeper
Posts: 15510
363
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you google "java module graph" you can probably easily find a tool that visualizes the dependency graph. I don't think it's necessary though.

One of your dependencies requires a module that is not available. Does it matter which one? Just declare a dependency on the artifact that contains the module and you're done.
 
L Foster
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just googling "java module graph" did not help.  Good thought, though.  I need to know in this case, because the module was deprecated and now removed in the latest java.  I have other dependencies and one of them is trying to depend on this.  I wish I could just snap in things as needed to a modules file, but even my brief experience has taught me it is never that simple.
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What module is deprecated?

Don't mix up modules and artifacts. For instance, even though javax.xml.bind has been removed from Java SE and superseded by jakarta.xml.bind, the module name in both cases is java.xml.bind, and it's only the artifact name that has been changed.
 
L Foster
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found a way to answer my own question.  Not sure if there may be a better way out there, but here goes.


Even though there are still issues in the project, these dependencies are still spelled out.  Still have to read it, though ;-)
 
L Foster
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just replying to Mr. Van Hulst,

The one I was looking at was called "java.activation".   My module file has to "require jakarta.activation"--and that's been there since I moved up to Java 11.  However, I oddly saw this message about "java.activation".

As I said, I wanted to learn about tools here.  Thank you
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:What module is deprecated?

Don't mix up modules and artifacts. For instance, even though javax.xml.bind has been removed from Java SE and superseded by jakarta.xml.bind, the module name in both cases is java.xml.bind, and it's only the artifact name that has been changed.


That holds for Jakarta EE 8. From Jakarta EE 9 onwards, the module and package roots have changed from java(x) to jakarta. For instance, the module name for JAXB (which now stands for Jakarta XML Binding...) has changed to jakarta.xml.bind, and the root package is now jakarta.xml.bind.
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unlike just about all of the other Jakarta EE 8 modules, jakarta.activation-api uses module name jakarta.activation from its first version, 1.2.1 (not java.activation).

Module java.activation does exist, but only from javax.activation-api version 1.2.0. I couldn't find any earlier versions. That means that if you somehow you have a transitive dependency on javax.activation-api. I checked my local Maven repository, and I found that JAXB 2.3.1 and earlier require it. JAXB 2.3.2 (now part of Jakarta EE 8) requires jakarta.activation.
reply
    Bookmark Topic Watch Topic
  • New Topic