digama0 / mmj2

mmj2 GUI Proof Assistant for the Metamath project
GNU General Public License v2.0
72 stars 24 forks source link

mmj2 bad version check; remove? #36

Open cwitty opened 4 years ago

cwitty commented 4 years ago

When I tried to run mmj2, it failed with this error:

Exception in thread "main" java.lang.NumberFormatException: For input string: "14-ea"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
        at java.base/java.lang.Integer.parseInt(Integer.java:652)
        at java.base/java.lang.Integer.parseInt(Integer.java:770)
        at mmj.util.BatchMMJ2.checkVersion(BatchMMJ2.java:129)
        at mmj.util.BatchMMJ2.<init>(BatchMMJ2.java:40)
        at mmj.util.BatchMMJ2.main(BatchMMJ2.java:51)

It's complaining because it can't parse the version; sure enough:

$ java -version
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+36-Debian-2)
OpenJDK 64-Bit Server VM (build 14-ea+36-Debian-2, mixed mode, sharing)

my Java version seems to be "14-ea". (This is on a reasonably current Debian testing, using Debian's openjdk-14-jdk package version 14~36-2.)

Since the code is checking to make sure you have at least Java 1.5 (== J2SE 5.0), which was released over 15 years ago, maybe that function could just be deleted? If somebody hasn't upgraded their Java version in 15 years, I don't think mmj2 is going to be what pushes them to do it... (I simply commented out the entire body of checkVersion() and recompiled, which resulted in a working version.)

david-a-wheeler commented 4 years ago

Can you please create a pull request that removes the version check?