miciek / grokkingfp-examples

All examples and exercises from the Grokking Functional Programming book
https://www.manning.com/books/grokking-functional-programming?utm_source=michal&utm_medium=affiliate&utm_campaign=book_khan_grokking_6_26_19&a_aid=michal&a_bid=7c041142
134 stars 51 forks source link

Unable to build project in windows 11 #139

Closed Vajra001 closed 1 year ago

Vajra001 commented 1 year ago

I have java 1.8 get this error, when building with sbt:

[info] compiling 35 Scala sources and 21 Java sources to C:\Documents\Functional Programming\grokkingfp-examples-master\target\scala-3.2.2\classes ...
[error] C:\Documents\Functional Programming\grokkingfp-examples-master\src\main\java\ch11_QueryingWikidata.java:1:1: cannot access org.apache.jena.query.QueryExecution
[error]   bad class file: C:\Users\techn\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\apache\jena\jena-arq\4.7.0\jena-arq-4.7.0.jar(org/apache/jena/query/QueryExecution.class)
[error]     class file has wrong version 55.0, should be 52.0
[error]     Please remove or make sure it appears in the correct subdirectory of the classpath.
[error] org.apache.jena.query.QueryExecution
[error] (Compile / compileIncremental) javac returned non-zero exit code
[error] Total time: 21 s, completed Feb 22, 2023 11:02:01 AM
ezoerner commented 1 year ago

I also see this if sbt is using Java 1.8 (JDK 8). The fix is to make sure sbt is using a newer JDK, such as JDK 17+.

miciek commented 1 year ago

@Vajra001 As @ezoerner said, you need a modern Java (JDK) version. The README and the book describe the installation process of JDK 17 which is the latest LTS version: https://github.com/miciek/grokkingfp-examples#installing-the-tools

However, the code will work with JDK 11 as well :)

Vajra001 commented 1 year ago

Thanks Miciek Jim

On Sat, Feb 25, 2023 at 3:42 AM Michał Płachta @.***> wrote:

@Vajra001 https://github.com/Vajra001 As @ezoerner https://github.com/ezoerner said, you need a modern Java (JDK) version. The README and the book describe the installation process of JDK 17 which is the latest LTS version: https://github.com/miciek/grokkingfp-examples#installing-the-tools

However, the code will work with JDK 11 as well :)

— Reply to this email directly, view it on GitHub https://github.com/miciek/grokkingfp-examples/issues/139#issuecomment-1445062593, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6CEM5JMDMEJHV5WUOTRKQ3WZHV3VANCNFSM6AAAAAAVEXC2XM . You are receiving this because you were mentioned.Message ID: @.***>