-1

I know there are lots of similar questions to this one, but they don't cover my situation: "1.-", where the - isn't a placeholder or a negative number but is exactly what the error log states.

10:01:41: Executing task 'build'...

Starting Gradle Daemon...
Gradle Daemon started in 4 s 748 ms

> Configure project :
Java: 14.0.1 JVM: 14.0.1+7(Oracle Corporation) Arch: amd64
New Dep: net.minecraftforge:forge:1.16.4-35.1.37_mapped_snapshot_20201028-1.16.3

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> error: invalid source release: 1.-

* 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 https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 33s
1 actionable task: 1 executed
10:02:18: Task execution finished 'build'.

I tried several solutions to questions containing exact numbers describing what source release is invalid, but none of them worked. It also worked fine yesterday and stopped working after I restarted IntelliJ.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
  • saying "this is not a duplicate" doesn't automatically so. I would say this part somewhat explains your issue: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0." – Stultuske Feb 12 '21 at 09:13
  • well I yesterday it worked alright after restarting intellij now i get this – Java Wizard Feb 12 '21 at 09:14
  • 2
    I know you say it's not a duplicate, but have you actually tried all the suggestions in this post? I'm pretty sure at least one of them will be the cause of your problem. [Error:java: invalid source release: 8 in Intellij. What does it mean?](https://stackoverflow.com/questions/25878045/errorjava-invalid-source-release-8-in-intellij-what-does-it-mean) – DPWork Feb 12 '21 at 09:29
  • Add your relevant gradle files for good measure. See [mre] – Zoe Feb 12 '21 at 09:30
  • 1
    @JavaWizard then you should figure out what updates/changes have been done – Stultuske Feb 12 '21 at 09:31

1 Answers1

0

It turned out that while closing intellij intellij rewrote sowmething in my build.gradle:

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' + '' // Need this here so eclipse task generates correctly.

should be it but it was :

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.-' + 
'' // Need this here so eclipse task generates correctly.