# Use JPL as a java module in gradle project calling prolog from java

**URL:** <https://swi-prolog.discourse.group/t/use-jpl-as-a-java-module-in-gradle-project-calling-prolog-from-java/9009>\
**Category:** Help!\
**Created:** [May 15, 2025, 5:20pm UTC](https://swi-prolog.discourse.group/t/use-jpl-as-a-java-module-in-gradle-project-calling-prolog-from-java/9009 "2025-05-15T17:20:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbsoftdj](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/hbsoftdj/32/7173_2.png) [@hbsoftdj](https://swi-prolog.discourse.group/u/hbsoftdj)\
**Post date:** [May 15, 2025, 5:20pm UTC](https://swi-prolog.discourse.group/t/use-jpl-as-a-java-module-in-gradle-project-calling-prolog-from-java/9009/1 "2025-05-15T17:20:18Z")

</div>

I’m using:  
SWI-Prolog (threaded, 64 bits, version 9.2.9)  
JPL 7.6.1 (comes with the above SWI-Prolog install)

I want the code to: call prolog from Java project with a module-info.java file. If I do not make the java project modular and drop the module-info.java file, then everything works fine.

My module-info.java looks like this:

module prologtojava {  
exports p2j;  
requires jpl;  
}

But what I’m getting is gradle errors at the compile stage:  
error: module not found: jpl  
error: package org.jpl7 is not visible

I have  
implementation(“jpl:jpl:7.6.1”)  
correctly specified in the gradle dependencies

I have also tried  
requires jpl7;  
or  
requires org.jpl7;  
but both give ‘module not found’ error.

Is it not possible to use the jpl.jar as an automatic module?  
Any insight regarding this would be welcome.
