Short Version
What file do i have to delete from what folder to stop the error:
The package %s is accessible from more than one module: <unnamed>, %s
Long Version
When trying to build a Java web-site, i am getting the error:
The package %s is accessible from more than one module: <unnamed>, %s
For example:
The package org.w3c.dom is accessible from more than one module: \<unnamed\>, java.xml
The package javax.xml.parsers is accessible from more than one module: \<unnamed\>, java.xml
The package netscape.javascript is accessible from more than one module: \<unnamed\>, jdk.jsobject
The package org.xml.sax is accessible from more than one module: \<unnamed\>, java.xml
Now:
- I don't know what a module is
- and i don't know what a package is
But i do get get the sense that i need to delete a file (maybe a .jar
file), or i need to edit a configuration file to remove a line, or i need to delete files elsewhere on my computer, or i need to delete environment variables.
- i don't know what file to delete
- i don't know what
.jar
file to delete - i don't know what text file to edit
- i don't know what configuration file to edit
- i don't know what line in what text file to add, edit, or remove
So, how do i:
Make package %s not accessible from more than one module
Apparently it is an bug added with Java 9 and the Java Platform Module System (JPMS), and it is not anything to do with Eclipse, NetBeans, or any IDE. It is a rule that was always there, but only Java 9 started enforcing it.
- Some say you can disable the JPMS by deleting
module-info.java
- Others insist that you cannot disable JPMS at all after Java 8, and you just have to live on Java 8
- Some have said that if you delete
module-info.java
it will get re-created
I don't have a module-info.java
file anywhere in the folder or subfolders of the project
- Others suggest it is an issue with
classpath
, ormodulepath
Although i don't have a classpath or modulepath set:
>echo %classpath%
%classpath%
>echo %modulepath%
%modulepath%
>echo %java_home%
C:\Program Files\Java\jdk-18.0.1.1
IDE: Visual Studio Code
Project structure
The web-site is make up of a structure of files and folders. Some are probably there by convention, some are probably there by rule, and some may have been a dumping ground for extra stuff. I don't know which is which:
- .vscode
- build
- conf
- dist
- JMeter
- LibrarySourceCode
nbproject(deleted in an attempt to fix the issue)- sql
- src
- WebRoot
- applets
- META-INF
- WEB-INF
- classes
- lib
- activation.jar
- cglib-full-2.0.2.jar
- commons-beanutils.jar
- commons-codec-1.3.jar
- commons-collections-2.1.1.jar
- commons-collections4-4.4.jar
- commons-compress-1.20.jar
- commons-dbcp-1.2.1.jar
- commons-digester.jar
- commons-fileupload.jar
- commons-lang-1.0.1.jar
- commons-logging-1.2.jar
- commons-math3-3.6.1.jar
- commons-pool-1.2.jar
- commons-validator.jar
- curvesapi-1.06.jar
- dom.jar
- dom4j-1.4.jar
- ehcache-0.9.jar
- hibernate2.jar
- itext-1.4.jar
- jakarta-oro.jar
- jaxen-full.jar
- jaxp-api.jar
- jmf.jar
- jstl.jar
- jta.jar
- log4j-1.2-api-2.17.1.jar
- log4j-api-2.17.1.jar
- log4j-core-2.17.1.jar
- log4j-jcl-2.17.1.jar
- mail.jar
- odmg-3.0.jar
- ooxml-schemas-1.1.jar
- plugin.jar
- poi-3.9-20121203.jar
- poi-ooxml-3.9-20121203.jar
- poi-ooxml-schemas-3.9-20121203.jar
- sax.jar
- saxpath.jar
- sessionmon.jar
- sqljdbc41.jar
- standard.jar
- struts.jar
- xalan.jar
- xercesImpl.jar
- xml-apis.jar
- xmlbeans-3.0.1.jar
- xmlbeans-4.0.0.jar
- xmlbeans-5.0.3.jar
- tags
build.xml(deleted in an attempt to fix the issue)
Research Effort
That's a restriction by the Java Platform Module System (JPMS), not by Eclipse (so don't shoot the messenger). If you delete the file module-info.java in your default package (which disables JPMS) it should work with Java 9 or higher.
- Eclipse is confused by imports ("accessible from more than one module")
- Package accessible from more than one module: <unnamed>
- The package org.xml.sax is accessible from more than one module: <unnamed>, java.xml
- The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml in eclipse webservice
- The package is accessible from more than one module (Error fix for using SAX in Eclipse)
- The package java.util is accessible from more than one module: <unnamed>, java.base while adding 'android.jar' in classpath
- The package java.util is accessible from more than one module: error
- Eclipse error The package javax.xml.datatype is accessible from more than one module: <unnamed>, java.xml - split packaging
- The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml
- The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml
- Error importing org packages - accessible from more than one module
- Eclipse RCP , The packagexxx is accessible from more than one module: <unnamed>
- Package is accessible from more than one module
- The package javax.xml.namespace is accessible from more than one module
- Package accessible from more than one module in Eclipse RCP
- The package org.json is accessible from more than one module: <unnamed>, org.json
- Java 11 migration: Package is accessible from more than one module issue
- VSCode: The package is accessible from more than one module
- The package *** is accessible from more than one module
- The package javax.xml.transform is accesible from more than one module
- The package is accessible from more than one module problem under VSCode only
- Java 8 to Kava 11 migration issue
- Specific question concerning "The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml"
- Package is accessible from more than one module in JDK 11 Module system
- Java build issues - Java 8 to Java 11 migration
- how to solve javax.xml.namespace is accessible from more than one module with jdk11
- The package org.openqa.selenium is accessible from more than one module