open-ortho / dcm4ceph

Convert Cephalograms from JPEG to DICOM.
MIT License
0 stars 2 forks source link

Add .jar distribution that will run on MS-Windows. #4

Closed zgypa closed 1 year ago

zgypa commented 2 years ago

Description

Being that this code will be used at Case Western Reserve University, it needs to be able to run on their workstations, and therefore needs to be in a form that can be distributed. The build process needs to produce a build that can be run using java -jar dcm4ceph.jar. And it needs to work with latest Java versions (17). During the process, some basic clean-up is expected (like removing unnecessary targets or pom.xml files).

zgypa commented 2 years ago

In current commit 2da270cc821d6fcbc6fae1d45c11aacd880804f5 i am struggling with the following error:

PS C:\Users\afm\git\open-ortho\dcm4ceph> java -jar dcm4ceph-tool\dcm4ceph-tool-ceph2dicomdir\target\dcm4ceph-tool-ceph2dicomdir-0.1.1-jar-with-dependencies.jar --file .\dcm4ceph-sampledata\B1893F12.jpg
Converting single TIF file to DCM.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO: Loading Properties file ceph_defaults.properties
Exception in thread "main" java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
        at org.antoniomagni.dcm4ceph.util.FileUtils.loadProperties(FileUtils.java:157)
        at org.antoniomagni.dcm4ceph.core.Cephalogram.init(Cephalogram.java:137)
        at org.antoniomagni.dcm4ceph.core.Cephalogram.<init>(Cephalogram.java:113)
        at org.antoniomagni.dcm4ceph.core.Cephalogram.<init>(Cephalogram.java:105)
        at org.antoniomagni.dcm4ceph.tool.ceph2dicomdir.Ceph2Dicom.main(Ceph2Dicom.java:111)

Reading online, it looks like it might be related with running on a newer java version. But if i want to upgrade to new Java 11, i would have to use the new version of dcm4che libraries as well. I think i need to check that all my maven stuff is pointing to the correct java.

But, isn't Java always forward compatible? I mean, i have code written for Java 8 (1.8), should it not run also on Java 17 without issues? Either way, the code needs to be updated at some point.