PGWelch / com.opendoorlogistics

http://www.opendoorlogistics.com
GNU Lesser General Public License v3.0
80 stars 45 forks source link

Will Not Run as Configured in JAVA v11+ #55

Open mjzwick opened 2 years ago

mjzwick commented 2 years ago

I am not a Java programmer, but I do use ODL Studio to support our scout troop with our annual mulch delivery sale - it has been a real help in delivering 7,000 to 10,000 bags of mulch. The sale was postponed in 2021 due to COVID. Since then I have updated my Java installation on my Mac to:

java 17.0.2 2022-01-18 LTS Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86) Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)

When I try to run the jar file for v1.4.1, I get errors associated with the program not being able to find the JAXB library. If I understand correctly, this library was moved out of JAVA SE to JAVA EE and is therefore no longer visible. A sample of the dump below:

Exception in thread "main" java.lang.ExceptionInInitializerError at com.opendoorlogistics.studio.scripts.list.ScriptsTree.setFiles(ScriptsTree.java:326) at com.opendoorlogistics.studio.scripts.list.ScriptsTree.(ScriptsTree.java:221) at com.opendoorlogistics.studio.scripts.list.ScriptsPanel.(ScriptsPanel.java:149) at com.opendoorlogistics.studio.appframe.AppFrame.(AppFrame.java:214) at com.opendoorlogistics.studio.appframe.AppFrame.(AppFrame.java:179) at com.opendoorlogistics.studio.appframe.AppFrame.main(AppFrame.java:123) Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext at com.opendoorlogistics.core.scripts.io.ScriptIO.(ScriptIO.java:73) at com.opendoorlogistics.core.scripts.io.ScriptIO.(ScriptIO.java:78) at com.opendoorlogistics.core.scripts.io.ScriptIO.(ScriptIO.java:50) ... 6 more Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext at com.opendoorlogistics.core.scripts.io.ScriptIO.(ScriptIO.java:70) ... 8 more Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 9 more

I suppose I need to revert back to JAVA SE 10 for now if that is possible. However, this seems like something that should be updated in ODL Studio. I don't really have the chops to do this!

PGWelch commented 2 years ago

Hi Morris,

it's good to hear what your scouts are doing with ODL Studio! At the moment yes your only option is to downgrade. ODL Studio actually works for Java 8 so I'm surprised you got it working with Java 10 before. Java has had a lot of releases recently, but java 8 is still really popular among developers. This site - https://adoptium.net/ - lets you download older versions of the java software development kit (JDK) which has a java runtime embedded within it, so if you have trouble downgrading try there.