facebook / buck

A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
https://buck.build
Apache License 2.0
8.56k stars 1.16k forks source link

Unable to build buck. Java class file version error. #2724

Open ljubinkovicdj93 opened 2 years ago

ljubinkovicdj93 commented 2 years ago

Description

I've cloned the repo but I'm unable to build buck. There was an identical issue: #2355 which got closed.

Steps to reproduce

I've tried compiling with java 8, 11 and 18... 8 and 11 pass, although when trying to build buck with java 8 it says:

ant command fails when using java 18 with the following:

compile:
    [javac] Compiling 1 source file to /Users/ljd1bg/Desktop/buck/ant-out/classes
    [javac] [compiled 86 lines in 343 ms: 250.7 lines/s]
    [javac] ----------
    [javac] 1. ERROR in /Users/ljd1bg/Desktop/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_12 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 2. ERROR in /Users/ljd1bg/Desktop/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_13 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 3. ERROR in /Users/ljd1bg/Desktop/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_14 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 4. ERROR in /Users/ljd1bg/Desktop/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_15 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 5. ERROR in /Users/ljd1bg/Desktop/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_16 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 6. ERROR in /Users/ljd1bg/Desktop/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_17 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 7. ERROR in /Users/ljd1bg/Desktop/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_18 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 7 problems (7 errors)

BUILD FAILED
/Users/ljd1bg/Desktop/buck/build.xml:613: The following error occurred while executing this line:
/Users/ljd1bg/Desktop/buck/build.xml:555: Compile failed; see the compiler error output for details.

Total time: 4 seconds

Java Version

java -version                                                                                                                                                                                                          
    java version "11.0.16.1" 2022-08-18 LTS
    Java(TM) SE Runtime Environment 18.9 (build 11.0.16.1+1-LTS-1)
    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.16.1+1-LTS-1, mixed mode)

javac -version
    javac 11.0.16.1
AnthonyUccello-Faire commented 1 year ago

I am getting the exact same issue. Are you on an M1 machine (I am)?

douglascarvalho commented 1 year ago

same error here, I'm on Mac Intel.

ljubinkovicdj93 commented 1 year ago

@AnthonyUccello-Faire Sorry, I just revisited this. No, I'm on Mac Intel