Fluorescent Flamingo Posted March 25, 2020 Share Posted March 25, 2020 (edited) EDIT: SOLVED by fixing my Java JDK installation. Gradle was trying to use an old Java version that didn't exist, so I downloaded the newest Java 8 JDK, and added the line 'org.gradle.java.home=C:/Program Files/AdoptOpenJDK/jdk-8.0.242.08-hotspot' to my gradle.properties file. Hi everyone, In trying to setup Forge for 1.15.2 (Eclipse) I keep running into the same problem. This is what I've done: Downloaded the Forge MDK (latest version, 1.15.2 - 31.1.27 - though I also tried with the Recommended version) Extracted all the files into my development folder Downloaded Gradle for Eclipse, and imported the development folder into Eclipse as a Gradle project Run gradlew eclipse in the development folder The problem is that when I open Eclipse, none of the Minecraft or Forge classes are on the build path, and I can't view any of the game source code in package explorer. The issue seems to be that it can't download the source code. This is the error log that I get when I run gradlew --refresh-dependencies: I also get errors in Eclipse showing that the project is missing the Forge source as a required library. Here is my build.gradle file attached (I haven't edited it at all yet) Spoiler buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'modid' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. minecraft { // The mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD Snapshot are built nightly. // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'snapshot', version: '20200225-1.15.1' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/') mods { examplemod { source sourceSets.main } } } } } dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.15.2-31.1.27' // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version" // Real examples // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // These dependencies get remapped to your current MCP mappings // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } // Example configuration to allow publishing using the maven-publish task // This is the preferred method to reobfuscate your jar file jar.finalizedBy('reobfJar') // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing //publish.dependsOn('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } I've tried recreating the entire setup multiple times from scratch, using both the latest and recommended versions, and each time I get this error. I've read the instructions at https://mcforge.readthedocs.io/en/latest/gettingstarted/ but it doesn't seem to cover how you get the project up and running. I've looked around other threads on this forum but to no avail. What am I doing wrong? Any help would be very highly appreciated. Edited March 25, 2020 by Fluorescent Flamingo Quote Link to comment Share on other sites More sharing options...
Ugdhar Posted March 25, 2020 Share Posted March 25, 2020 I still use the commandline to setup my projects for eclipse, i.e. Quote gradlew eclipse gradlew genEclipseRuns Then import into eclipse as an Existing Project as opposed to a gradle project. I couldn't tell you the reason why, but I have to set the project up *twice* before the sources are available to me when I import existing project into eclipse. Trying to run the gradle tasks within eclipse hasn't really worked for me. Quote Link to comment Share on other sites More sharing options...
Torq Posted March 25, 2020 Share Posted March 25, 2020 (edited) I just copied the source code, imported the gradle project, and ran tasks for all IDEs. I have IntellijIDEA, Eclipse, VScode working with vanilla source. IMPORTANT! You need to wait until IDE downloads and prepares all the files. gradle tasks --all By the way, I recommend specifying "org.gradle.java.home = ? / Program Files / Java / jdk1.8.0_241" in gradle.properties Edited March 25, 2020 by Torq Quote If I helped you, don't forget like. I'm using a translator, sorry. Link to comment Share on other sites More sharing options...
Fluorescent Flamingo Posted March 25, 2020 Author Share Posted March 25, 2020 Thanks very much for both of your replies. I found out that I had a broken JDK installation, so I installed a new one and pointed to it in the gradle.properties, and then I was able to run gradlew eclipse as normal! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.