I'm trying to execute the gradlew genSources command here, but it says I'm using an outdated version of java, and that I at least must have Java version 17.
PS D:\Coding Stuff\Java Projekte\Minecraft Mods\fabric-example-mod-1.19> ./gradlew genSources
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Coding Stuff\Java Projekte\Minecraft Mods\fabric-example-mod-1.19\build.gradle' line: 2
* What went wrong:
An exception occurred applying plugin request [id: 'fabric-loom', version: '1.0-SNAPSHOT']
> Failed to apply plugin 'fabric-loom'.
> You are using an outdated version of Java (8). Java 17 or higher is required.
* 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
BUILD FAILED in 621ms
I went to File > Project Structure > Project and the SDK property is clearly set to openjdk-19, the language level property is set to SDK default(19). I went to Settings > Build, Execution, Deployment > Build Tools > Gradle, which tells me that the Gradle JVM property is set to Project SDK openjdk-19.
using a Windows 10 machine
Well, you must use Java 17, because Minecraft 1.19 uses this Java version :)
Since minecraft 1.19 was architectured around jdk-17, some methods end up breaking when running it on jdk-19, meaning the game won't even start.
if you set it to run with jdk-17, it should work fine
Related
In one of my projects I get a gradle error message whenever I try to run code in debug mode (^D):
...
> Task :apps:travel-information-service:testClasses UP-TO-DATE
> Task :apps:travel-information-service:test FAILED
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/lx/lnqmbcy557ndwxld1hbsjlf00000gn/T/ijresolvers.gradle' line: 347
* What went wrong:
Execution failed for task ':apps:travel-information-service:test'.
> System property 'idea.debugger.dispatch.port' is not set
* 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
BUILD FAILED in 4s
Searching for this issue did not give any results.
It does not matter which code I try to debug (Java applications, junit tests, etc all give the same error). Running the code normally (non-debug mode) works fine. My other projects are fine using the same version of Intellij. I have tried rebooting, invalidating the caches in Intellij, reimporting the gradle project, and even completely removing the .idea directory.
Any tips on how to investigate (or even fix ;-)) this issue are greatly appreciated!
I'm using Gradle build tool and I can't get the source code and docs for spark-core.
I've already searched and applied:
idea {
project {
jdkName = '1.8'
languageLevel = '1.8'
}
module {
downloadJavadoc = true
downloadSources = true
}
}
But it still doesn't work for me. I suppose I'm missing something like rebuild the whole project or download just these pieces.
I applied ./gradlew cleanIdea idea as well.
When I try to click with pressed command on SparkConf.class I press Download Sources I get Sources not found for: org.apache.spark:spark-core_2.12:2.4.5
And the result from the run tab:
21:11:29: Executing task 'DownloadSources'...
:DownloadSources FAILED
BUILD FAILED
Total time: 0.124 secs
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/06/97bzw1l51r59l65thfzs7hd80000gn/T/ijmiscinit1.gradle' line: 14
* What went wrong:
Execution failed for task ':DownloadSources'.
> Could not resolve all dependencies for configuration ':downloadSourcesFrom_MavenRepo_91653a2f-0439-4794-b77a-3812f9926728'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
21:11:29: Task execution finished 'DownloadSources'.
Here is 2 pretty long task outputs:
DownloadSources --info: https://pastebin.com/D07JmGXT
DownloadSources --stacktrace: https://pastebin.com/6ceKhwrk
Idea.log https://pastebin.com/EQcDxPwb
Latest public Intellij build: 2020.1.1 installed via Toolbox
Latest MacOS: 10.15.4
Java 1.8 jdk-8u251-macosx-x64.dmg, downloaded from oracle.com
Could you please help me to realize what should I do to fix it?
The problem belongs to Scala plugin.
If you face this issue, it doesn't matter on build tool you are using Maven or Gradle probably installation of the Scala plugin solves your problem.
My Intellij report: https://intellij-support.jetbrains.com/hc/en-us/requests/2686145
Well-known bug: https://youtrack.jetbrains.com/issue/IDEA-127193
Using libGDX, and TomGrill's gdx-testing's tests subproject, and trying to run with gradle (gradlew tests:test) the default example from the examples directory and I get this error.
Testing started at 14:47 ...
14:47:05: Executing task 'test'...
Executing tasks: [test]
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.NullPointerException (no error message)
* 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
BUILD FAILED in 0s
14:47:06: Task execution finished 'test'.
If I try to run it with IntelliJ's run-tests button
I get the error
Process finished with exit code 1
Class not found: "de.tomgrill.gdxtesting.examples.AssetExistsExampleTest"Empty test suite.
And last, if I try to run only one test from said suite I get the same error.
What am I doing wrong?
Turns out the error was with Gradle versions. I updated to the newest version of Android Gradle Google provides, and used a newer local Gradle as that was needed, and for some reason, this doesn't work. Made a new empty project and left the original Gradle versions, and the tests ran. There might be a better way to fix this, however, I'm going to go with this.
My Ionic/Cordova app has all of a sudden stopped building on Android after updating the Ionic and Cordova CLI. I've spent the last 2 days searching Google for a solution but I couldn't find anything that has helped. I'm assuming it's something to do with Cordova now using Gradle to build instead of Apache Ant. My Android SDK and build tools are all up to version 22, Gradle 2.2, Ant 1.9.4, JDK 8.
Other details:
Cordova CLI: 5.1.1
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
OS: Mac OS X Yosemite
Node Version: v0.12.7
When I run ionic build android, I get this error:
FAILURE: Build failed with an exception.
* Where:
Script '/platforms/android/CordovaLib/cordova.gradle' line: 128
* What went wrong:
A problem occurred evaluating root project 'android'.
> No match found
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.426 secs
/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /platforms/android/gradlew with args: cdvBuildDebug,-b,/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
You might need to set the android-versionCode in your config.xml file. I had a similar issue that was resolved by changing the code from "0.0.1" to "1". Apparently Android wants a single integer value.
In my config.xml I had to change this:
<widget id="com.acme.appname" version="0.0.1" android-versionCode="0.0.1" ios-CFBundleVersion="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
to this:
<widget id="com.acme.appname" version="0.0.1" android-versionCode="1" ios-CFBundleVersion="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
android-versionCode
I hope this helps.
My project has an interesting issue with Gradle. When running "gradle build" from inside Intellij 13 (windows or linux), I get the following error message:
10:05:48 PM: Executing external task 'build'...
:processResources UP-TO-DATE
:compileAspect FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileAspect'.
> Error creating temporary file
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.434 secs
Access is denied
10:05:56 PM: External task execution finished 'build'.
From here, I ran a full debug located here: Pastebin
Which shows it failing in the AjcTask.java file at the below line:
1993 tmpFile = File.createTempFile("argfile", "", userDir);
Might be related to GRADLE-1400 which is for and older version but unresolved. On linux, if I cd to the project directory, I can run "gradle build" without trouble after that first time, then I can run it from Intellij as well without an issue.
Maybe the environment vars getting nuke somehow?
It looks like GRADLE-2532.
user.dir property defaults to C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.1\jre\jre\bin in your case which causes Access Denied error.
In IDEA 13.1.2 and previous versions enabling Use customizable gradle wrapper option should help. This will set user.dir to the project root directory.
In IDEA 13.1.3 and later versions there are different workarounds available, check this comment.