1

I am trying to learn how to make minecraft mods and am following a tutorial using gradle. On one step of the tutorial he runs the empty mod using: Run > Run Configuration > Java Application > run client

Configuration Menu

When I go to run configuration, it doesn't show me any configurations installed and when I try to make one, it says: Launch configuration Trial references non-existing project TrialMod.

Error Message

Does anyone know how to fix this? The project clearly exists lol (u can see in background)

EDIT:


// For those who want the bleeding edge
buildscript {
    repositories {
        jcenter()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
    }
}
apply plugin: 'net.minecraftforge.gradle.forge'

/*
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
plugins {
    id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "2.0"
group= "com.oopermass.trialmod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "trialmod"

minecraft {
    version = "1.8.9-11.15.1.2318-1.8.9"
    runDir = "run"
    
    // 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 allways work.
    // simply re-run your setup task after changing the mappings to update your workspace.
    mappings = "stable_20"
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

dependencies {
    // 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'

    // the deobf configurations:  'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
    // except that these dependencies get remapped to your current MCP mappings
    //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
    //deobfProvided '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

}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

  • The project is not configured as a Java project, so the .java files will not be compiled and cannot be executed. Does right-clicking and choosing _Grade > Refresh Gradle Project_ help? If not, please add the content of your `build.gradle` file as text formatted as _Code Sample_ to your question. What is shown in the _Problems_ view? – howlger Jul 13 '22 at 07:23
  • The Run Configuration is showing you an error - at the top of the dialog. The project name can't have a \ character. – greg-449 Jul 13 '22 at 07:26
  • i ended up deleting the \ after i took the screenshot but it didn't help – CubeTastick N Jul 13 '22 at 07:29
  • The Classpath tab on the Run Configuration also has a red X as does the Project. You need to sort out all those errors. Looking at the Problems view may also help.. – greg-449 Jul 13 '22 at 08:48
  • I checked out the error it says: Description Resource Path Location Type Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-2.7-bin.zip'. Unable to make protected java.lang.Package[] java.lang.ClassLoader.getPackages() accessible: module java.base does not "opens java.lang" to unnamed module @135774d6 TutorialMod line 0 Gradle Error Marker Not sure how to fix it though... – CubeTastick N Jul 13 '22 at 09:43
  • That version of gradle is trying to do something that modern versions of Java don't allow anymore. You may need to specify an older Java (probably Java 8) in the run configuration, or use a newer gradle. – greg-449 Jul 13 '22 at 18:54
  • I am now trying to run gradle through java 1.8 but the recent version of eclipse only allows java versions 11+ from what I am seeing. Where could I get an older version of eclipse? [photo](https://gyazo.com/b4e3b0b0825856f1f16df9a4518fc05e) [photo](https://gyazo.com/6cc8cf7caf34956e5e7dd10917874367) – CubeTastick N Jul 13 '22 at 20:58
  • You don't need a older version of Eclipse. You can tell Eclipse to use older versions of Java to run programs - see my answer to your other question. – greg-449 Jul 14 '22 at 06:02
  • Which Buildship version do you have (see _Help > About Eclipse IDE_)? Your root problem is that your project is not a Java project (for unknown reasons). So your Java code will not be compiled and cannot be run. Telling about the errors you get for launching does not provide any helpful information about your root problem. – howlger Jul 14 '22 at 06:40

0 Answers0