Home > Blockchain >  Gradle build fails through Terminal but is successful is eclipse
Gradle build fails through Terminal but is successful is eclipse

Time:02-28

Task :compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':compileJava'.

error: invalid source release: 17

I have spent more than 5-6 hours fixing this issue. Due to this i am not able to run my application. Please help me out so that i can proceed

update: I am able to create build successfully in eclipse. but now it is failing with error Error: Could not find or load main class com.abc.ABCServiceApp Caused by: java.lang.ClassNotFoundException: com.abc.ABCServiceApp

and build is still failing through terminal with the same error C:\Users\user\Documents\abc\def\xyzservice>gradle build

Task :compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':compileJava'.

error: invalid source release: 17

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at enter image description here

    Update: lost my patience. Installed another eclipse and it workimg now

    CodePudding user response:

    It was a IDE issue, somehow it was picking Java17 even though after setting it to 15. Thank you all for your reply. It helped at least to know the root cause. I uninstalled the eclipse and re-installed a fresh one. It works now

  • Related