[MacPorts] #55587: junit 4.6 on 10.13 JUnitMatchers.java:87: error: incompatible types
MacPorts
noreply at macports.org
Tue Dec 26 14:04:38 UTC 2017
#55587: junit 4.6 on 10.13 JUnitMatchers.java:87: error: incompatible types
-----------------------+-------------------
Reporter: sandiway | Owner:
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.4.2
Resolution: | Keywords:
Port: junit |
-----------------------+-------------------
Description changed by mf2k:
Old description:
> 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).
>
> 1. 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.)
>
> 2. 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.)
>
> 3. 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:
New description:
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).
1. 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.)
2. 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.)
3. 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:
}}}
--
--
Ticket URL: <https://trac.macports.org/ticket/55587#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list