stleary / JSON-java

A reference implementation of a JSON package in Java.
http://stleary.github.io/JSON-java/index.html
Other
4.54k stars 2.56k forks source link

JDK8 Compatibility Broken #892

Closed melloware closed 6 months ago

melloware commented 6 months ago

Your pom.xml says Java 1.8 compatibility but you are including a META-INF/versions/9/module-info.class because of this plugin.

<plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
                <version>1.0.0.Final</version>
                <executions>
                    <execution>
                        <id>add-module-infos</id>
                        <phase>package</phase>
                        <goals>
                            <goal>add-module-info</goal>
                        </goals>
                        <configuration>
                            <jvmVersion>9</jvmVersion>
                            <module>
                                <moduleInfoSource>
                                    module org.json {
                                        exports org.json;
                                    }
                                </moduleInfoSource>
                            </module>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

This is causing errors in certain situations where JDK 8 it used and detecting that module-info.class.

stleary commented 6 months ago

@melloware Thanks for posting. Do you have any suggestions for fixing this?

melloware commented 6 months ago

So we got this exact report: https://github.com/primefaces/primefaces/issues/11870

but one user says JDK8 should ignore this module-info.class but it looks like that class is compiled with JDK9 or higher? Not sure if that is the plugin doing that or if it is something we are doing. No one else has complained about this on your project so I am wondering if it is something Jboss EAP specific or a problem in general?

rikkarth commented 6 months ago

Hi @melloware

Would you be able to provide steps to replicate the issue?

melloware commented 6 months ago

@rikkarth i can't reproduce it and for that version of our library i just downgraded to the last JDK8 version and it works. Our current library is all on Java 11 so I am expecting this is a legacy one off. I am OK closing this ticket.