cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.45k stars 159 forks source link

Error when first running generate-sources in jsweet-quickstart #707

Closed gregdingle closed 2 years ago

gregdingle commented 2 years ago

I tried to follow http://www.jsweet.org/getting-started/ . I got an error on running mvn generate-sources:

[ERROR] Failed to execute goal org.jsweet:jsweet-maven-plugin:3.1.0:jsweet (generate-js) on project jsweet-quickstart: 
Execution generate-js of goal org.jsweet:jsweet-maven-plugin:3.1.0:jsweet failed: 
Unable to load the mojo 'jsweet' in the plugin 'org.jsweet:jsweet-maven-plugin:3.1.0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/jsweet/JSweetMojo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I'm not a java programmer so I'm having trouble understanding what this means. Some kind of version incompatibility? I'm running java 8 openjdk on MacOS.

mvn -v
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: /usr/local/Cellar/maven/3.8.3/libexec
Java version: 1.8.0_312, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk@8/1.8.0+312/libexec/openjdk.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "11.5.2", arch: "x86_64", family: "mac"
lgrignon commented 2 years ago

Is this the same problem? https://github.com/cincheo/jsweet/issues/705#issuecomment-950340591

JSweet is perfectly working on macOS / OpenJDK JSweet 2 => Java 8 JSweet 3 => Java >= 11

gregdingle commented 2 years ago

705 is another error I got when using java 11. So with either java 11 or java 8 I get an error on installation, though different errors.

I'm new to java and maven so maybe I'm missing something obvious. Is there a way of installing java that you would recommend on macOS to be sure of the expected environment?

gregdingle commented 2 years ago

Thanks for the help. I got it to compile. I think my mistake was to brew install java instead of java11

It looks like JSweet 3 => Java == 11