-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libtiled-java incompatible with Java 11 #2048
Comments
I'd love to also drop JAXB from libtiled-java. But what does Java provide as an alternative? |
Sadly I don't really now if Java provides an alternative at all as I've never worked with XML and/or JAXB in Java, but I stumbled across some information which might help you: There seemed to be a way to use JAXB in Java 9 and 10, but it doesn't work in Java 11 anymore. |
I don't know exactly how, since JAXB seems to be still used, but Java 11 compatibility was restored by #1925. |
I'm still affected by this problem. As it seems to work in the mentioned pull request, maybe it's a problem with my small example project I just created with Gradle? I'm not really familiar with Maven. |
@MinecraftPlaye Hmm, while this incompatibility problem is probably fixed, the version of libtiled on Maven Central has not been updated with those changes. Could that be causing problems? Or are you using libtiled-java from source? |
I'm using the version from Maven Central. |
Ok, after some time figuring out how Maven works I got this far with compiling the code from this repository's master branch:
|
@MinecraftPlaye The version on Maven Central has now been updated. Could you verify whether this resolves your issue (and #2052)? |
Ok, I just tested it with version 1.2.3 from Maven Central. I'm not sure if this is intended, but without any modifications to my projects it does not work. Adding the same dependency from the maven script of libtiled to all my projects which depend on libtiled solves the problem (tested with the TiledLevelTest.zip from above)
|
@mikepthomas Is there a dependency we could add somewhere to avoid users like @MinecraftPlaye needing to add this? |
https://github.com/bjorn/tiled/blob/master/util/java/libtiled-java/pom.xml#L151 This should add the dependencies for any version of Java over version 1.9... it seems to be working fine for tmxviewer-java fine however this is probably because it is a Maven project, I don’t have much experience with Gradle but my guess is that this profile is not being automatically enabled |
@mikepthomas Alright, thanks for the quick answer! @MinecraftPlaye Maybe you can figure out a way to make this work automatically also with Gradle? If not I guess it would be good to mention the need to add this dependency in the |
Alright, I looked into it and could not find anything which resolves this problem. There are a few open issues on Gradle with Maven POM files regarding transitive dependencies, but as far as my understanding of Gradle and especially Maven goes, those are not the cause for this problem. I did however found this while looking up the Gradle documentation: Gradle Module Metadata . You could potentially provide this file alongside the POM file. In that case Gradle would ignore the POM file and use the Module Metadata file. |
@MinecraftPlaye Thanks for looking into it! If providing Gradle Module Metadata is a solution to this then I guess we'd be looking for somebody to maintain such a file. Or we can document the need to add this dependency for Gradle users. |
Using libtiled-java with Java 11 gives me the following error:
java.lang.NoClassDefFoundError: JAXBException
It seems to be caused by Java 11 removing java.xml.bind (JAXB).
The text was updated successfully, but these errors were encountered: