Opened 7 years ago
Last modified 5 years ago
#55587 closed defect
junit 4.6 on 10.13 JUnitMatchers.java:87: error: incompatible types — at Version 3
Reported by: | sandiway | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.4.2 |
Keywords: | Cc: | ||
Port: | junit |
Description (last modified by mf2k (Frank Schima))
I am compiling swi-prolog on 10.13 (yes I am running correct macports 2.4.2), which depends on junit and in turn hamcrest-core. There are Java versioning issues here, which I'm unable to resolve. A brief summary below. Note that I tried all possible cases (doing a full uninstall installed each time).
- Apple's legacy javaforosx.dmg doesn't work of course since ANT requires Java8.
(Cite: The Apache Ant team currently maintains two lines of development. The 1.9.x releases require Java5 at runtime and 1.10.x requires Java8 at runtime.)
- The latest Java9 doesn't work and results in the other error reported in Dec 2017 for junit 4.6 since 1.5 generates an error (not a mere warning, new for Java9)
(Cite: In JDK 8, -source and -target values of 1.5/5 and earlier were deprecated and caused a warning to be generated. In JDK 9, those values cause an error.)
- Therefore the only possible option will be to install using Java8.
Due to Apple's locking down of /usr, we set JAVA_HOME using: export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home" so we can use javac with Java8/9. (Note; hamcrest-core passes fine using Java8.)
unfortunately, junit 4.6 fails with
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_java_junit/junit/work/junit4.6/src/main/java/org/junit/matchers/JUnitMatchers.java:87: error: incompatible types: no instance(s) of type variable(s) LHS exist so that CombinableBothMatcher<LHS> conforms to CombinableMatcher<T> :info:build [javac] return CoreMatchers.both(matcher); :info:build [javac] ^ :info:build [javac] where LHS,T are type-variables: :info:build [javac] LHS extends Object declared in method <LHS>both(Matcher<? super LHS>) :info:build [javac] T extends Object declared in method <T>both(Matcher<? super T>) :info:build [javac] /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_java_junit/junit/work/junit4.6/src/main/java/org/junit/matchers/JUnitMatchers.java:99: error: incompatible types: no instance(s) of type variable(s) LHS exist so that CombinableEitherMatcher<LHS> conforms to CombinableMatcher<T> :info:build [javac] return CoreMatchers.either(matcher); :info:build [javac] ^ :info:build [javac] where LHS,T are type-variables: :info:build [javac] LHS extends Object declared in method <LHS>either(Matcher<? super LHS>) :info:build [javac] T extends Object declared in method <T>either(Matcher<? super T>) :info:build [javac] Note:
Change History (3)
comment:1 Changed 7 years ago by mf2k (Frank Schima)
Priority: | High → Normal |
---|
comment:3 Changed 7 years ago by mf2k (Frank Schima)
Description: | modified (diff) |
---|
The Priority field is for use by Macports team members only.