Closed weedySeaDragon closed 6 years ago
Looks like the problem is that jaxb is no longer included in JDK 9/10 (and beyond).
I haven't looked at your code, but according to this answer on SO, you need to explicitly add it to your build (conditionally, based on the detected JDK).
I'm now looked at the code and poked around a bit...
Adding this to jgnash-core/build.gradle
// required for JVM 1.9 and above:
// https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.4'
works for me when I run it with JVM 10 and also 8 (JVM 1.8). It does mean that the .jar file is added unnecessarily for anyone running < JVM 9 (a little bit of bloat), but the alternative is to add some conditional code to the .sh and .bat files generated to check the java version and then conditionally add the --add-modules...
option. That can certainly be done, but it means working with the right gradle plugin(s) to do it.
I can do a PR for this if needed.
The readme supplied with jGnash documents the need to add '--add-modules java.xml.bind' to the command line when operating with Java 10. It's solved the issue when I tested on Windows and Linux. The module appears to be there, just not loaded by default. Its untested on OSX.
Adding the jaxb-api caused issues when running under Java 8 last time I tried. A PR against the 3.0-dev branch would be fine as it will be target to run under Java 11 and newer.
Oracle created a bit of a mess between dropping JavaFX, the jaxb api, etc and sprinkled it between versions.
I didn't see the info in the README until later (after I had the problem and was investigating.) The README is not clear about the changes that you must do for Java 9 or 10. Yes, the information is in there, but it needs to be re-organized so that it's clear and easy to find. Ex:
--add-modules java.xml.bind
info in the README comes quite far down the documentIMO, you need the standard Requirements section in the README, and this is where you should note that if you're running Java 9 or 10, you must have the jaxb-api jar and you have to modify the command to run jGnash; it could specifically refer to the 'Install' section where the steps are spelled out (downloading the .jar
, where to put it, what file (.bat
or .sh
) to modify, etc.
You could put a note about Java 11 in the Requirements section (e.g. that jGnash won't run under it yet, but work is in progress).
Again: I totally agree that all of the information is in there, but reorganizing into more standardized sections will make it clearer so that people will understand what they have to do for their specific Java version and OS.
I can do a PR for the README so that you can see my suggestions.
I'll take a look at that branch in a few days.
Sorry, away for a few days.
A pull request with cleaned up documentation would be great.
No worries about the timing. :-)
will do a PR for the README. probably Wednesday or Thurs, just FYI.
Closing
(I'm not sure if this is the right place to submit this issue or if I should create a login on SourceForge and submit a ticket there.)
Expected Behavior
After a brand new install (my first time installing it), create a new file to work with
Actual Behavior
Runtime exception was thrown:
Here's the text from my terminal:
Steps to Reproduce the Problem
Specifications