LearnLib / automatalib

A free, open-source Java library for modeling automata, graphs, and transition systems
http://automatalib.net
Apache License 2.0
92 stars 34 forks source link

Java Building ERROR #23

Closed ray0728 closed 6 years ago

ray0728 commented 6 years ago

I cannot build this code in NetBeans. the error infomation is:

net/automatalib/graphs/IndefiniteGraph.java:[45,25] method transform in class com.google.common.collect.Iterators cannot be applied to given types;
  required: java.util.Iterator<F>,com.google.common.base.Function<? super F,? extends T>
  found: java.util.Iterator<E>,this::getTarget
  reason: cannot infer type-variable(s) F,T
    (argument mismatch; invalid method reference
      incompatible types: ? super F cannot be converted to E)
1 error
-------------------------------------------------------------
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------

How can I fix it?

mtf90 commented 6 years ago

Could you provide some additional information about your environment?

I'll try and see, if I can reproduce this issue with NetBeans.

ray0728 commented 6 years ago

I am using Netbeans 8.2 with JDK 1.8.0_20-b26. and without GUAVA. I build this AutomataLib as a Maven project directly. btw: I was downloaded master branch code only. should I build AutomataLib with GUAVA or use other branch code?

mtf90 commented 6 years ago

I tried to reproduce your error, but wasn't able to do so. I assume you just imported AutomataLib as a Maven project and then did 'Right click' > Build, right?

I noticed, that NetBeans by default uses a bundled Maven version (3.0.5) which seems to be too old. I needed to manually select my system installation (3.5.2). Also your JDK version seems rather old. My system installation is an OpenJDK 1.8.0_162-b12, the CI servers use 1.8.0_141-b15 (OpenJDK) and 1.8.0_151-b12 (OracleJDK). You could try to update your JDK to see if the errors persist.

May I ask, why you want to build AutomataLib? The code on the master branch is deployed to the Maven Central Repository. And recently, we have also set up continous deployment for development versions (see here) . So you can just declare a Maven dependency wherever you want to use AutomataLib. Unless you want to actively develop on AutomataLib, there is practically no need to build it yourself.

ray0728 commented 6 years ago

it's work now, after I update my JDK to the newest. thank you so much for your help. I wanna test my program with learnlib, but I cannot download learnlib and automatalib directly from maven repository. so I have to build it by myself