ra4king / CircuitSim

Basic Circuit Simulator
https://ra4king.github.io/CircuitSim
BSD 3-Clause "New" or "Revised" License
76 stars 27 forks source link

Use modules to support OpenJFX 11+, Java 11+ #63

Closed ausbin closed 4 years ago

ausbin commented 4 years ago

Hi Roi,

I was having some trouble running CircuitSim on Java 11, so I started messing with this

Maybe you already knew about this, but apparently Java 9 introduced "modules", and OpenJFX after Java 9 is distributed as these "modules". I still don't understand the benefit of them but I'm probably just not Java-woke enough

If you run ./gradlew jlink, the "badass" jlink plugin will generate build/image/bin/CircuitSim, a shell script which will launch CircuitSim. ./gradlew jlinkZip will generate build/CircuitSim.zip, a zip you can decompress somewhere to "install" CircuitSim. Spicy

Seems like Java 8 will be supported for about another year, but in case it's ever time to upgrade, I hope this helps

I think this is more of a starting point, though, since ./gradlew run doesn't work properly for example. According to ./gradlew run --debug, it actually runs:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java --add-modules javafx.controls --module-path [long ass path] --patch-module circuitsim=/home/austin/Documents/school/gatech/ta/CircuitSim/build/resources/main --module circuitsim/com.ra4king.circuitsim.gui.CircuitSim -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant circuitsim/com.ra4king.circuitsim.gui.CircuitSim

Those -Dx=y arguments and the classname at the end seem to be misplaced and are passed to CircuitSim as arguments (it tries to open each one as a circuit file and fails). I don't know if this is a bug in Gradle or the the plugin, or some kind of misconfiguration on my part.

ausbin commented 4 years ago

Looks like 4e0a9d0dfa60e470e3dc3272ee3fb4ed135f05c1 took care of this yee haw