cbeust / jcommander

Command line parsing framework for Java
Apache License 2.0
1.96k stars 334 forks source link

Java8 compatibility #473

Closed dadoonet closed 5 years ago

dadoonet commented 5 years ago

The latest version 1.75 provides classes which are not compatible anymore with Java8. Is that change made on purpose? If so, we should reflect that in the README I guess.

Here is my own build output:

Error:(22, 28) java: cannot access com.beust.jcommander.JCommander
  bad class file: /Users/dpilato/.m2/repository/com/beust/jcommander/1.75/jcommander-1.75.jar!/com/beust/jcommander/JCommander.class
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
spmason commented 5 years ago

Same here - 1.72 works fine, versions before 1.77 (released yesterday) give a manifest error when I try to use them, 1.77 gives the class file version error

Ideally I'd expect a breaking change like this to go alongside a major version bump as per semver, but I'm not sure what the versioning policy is for jcommander..

@cbeust any thoughts?

cbeust commented 5 years ago

I'm guessing I forgot to force class compatibility to Java 8 when I built that version, will fix this shortly.

cbeust commented 5 years ago

By the way, Java 8 was end of lifed at the beginning of this year, people still using it should seriously consider updating.

dadoonet commented 5 years ago

I'm totally fine updating my apps to java12. Just saying that in that case the documentation should be updated to reflect that change.

cbeust commented 5 years ago

Done: 1.78 is now on JCenter and will appear on Maven Central soon.

~/java/jcommander [master] $ javap -verbose -cp build/libs/jcommander-1.78.jar com.beust.jcommander.StringKey|grep major
  major version: 52