Jump to content

[solved]Build.gradle doesn't import in intellij


Recommended Posts

Posted

Hi all,

 

 

I am trying to use forge MDK to writing a mod with Intellij idea. I followed all the guides of README.txt file and even other online guides. I don't know why but when I import the build.gradle project in Intellij the Ide blocks in gradle: run build and doesn't import the projects someone with the same problem?

Posted

I may be an idiot that doesn't use IneliJ but I'm pretty sure you do not import the build.gradle project...

I was indeed an idiot...

 

I did not understand your answer.

 

I followed this guide that are in the README.txt file:

 

Step 1: Open your command-line and browse to the folder where you extracted the zip file.

 

Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:

 

Windows: "gradlew setupDecompWorkspace"

Linux/Mac OS: "./gradlew setupDecompWorkspace"

 

Step 3: After all that finished, you're left with a choice.

For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)

 

If you preffer to use IntelliJ, steps are a little different.

1. Open IDEA, and import project.

2. Select your build.gradle file and have it import.

3. Once it's finished you must close IntelliJ and run the following command:

 

"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)

 

Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)

 

If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again.

 

Should it still not work,

Refer to #ForgeGradle on EsperNet for more information about the gradle environment.

 

at the step 3 the underlined and bold text I cannot import the file.

 

I have just launch the gradlew program with arg --info and in the outputs I found that error:

file or directory '/Users/noemurr/Downloads/forge-1.10.2-12.18.1.2011-mdk/src/api/resources', not found

 

I think that it is important but I don't know I to resolve the problem.

Posted

I may be an idiot that doesn't use IneliJ but I'm pretty sure you do not import the build.gradle project...

I was indeed an idiot...

 

I did not understand your answer.

 

I followed this guide that are in the README.txt file:

 

Step 1: Open your command-line and browse to the folder where you extracted the zip file.

 

Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:

 

Windows: "gradlew setupDecompWorkspace"

Linux/Mac OS: "./gradlew setupDecompWorkspace"

 

Step 3: After all that finished, you're left with a choice.

For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)

 

If you preffer to use IntelliJ, steps are a little different.

1. Open IDEA, and import project.

2. Select your build.gradle file and have it import.

3. Once it's finished you must close IntelliJ and run the following command:

 

"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)

 

Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)

 

If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again.

 

Should it still not work,

Refer to #ForgeGradle on EsperNet for more information about the gradle environment.

 

at the step 3 the underlined and bold text I cannot import the file.

 

I have just launch the gradlew program with arg --info and in the outputs I found that error:

file or directory '/Users/noemurr/Downloads/forge-1.10.2-12.18.1.2011-mdk/src/api/resources', not found

 

I think that it is important but I don't know I to resolve the problem.

Are you sure you did steps 1/2?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

I am very sure.

 

I did that steps 10 times, with several MDKs (1.10.2, 1.9, 1.10, 1.9.4). Always the same problem.

 

When I follow the step 2 if I add the arg --info to the command I always find the same error:

file or directory '/Users/noemurr/Downloads/forge-1.10.2-12.18.1.2011-mdk/src/api/resources', not found

 

I also tried to use eclipse and using it I can open the project but the ide doesn't find the external libraries.

 

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

 

It works! I had already added the line idea{module{inheritOutputDirs = true}} but I didn't run again the ./gradlew setupDecompWorkspace.

 

thanks for your help!

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

 

It works! I had already added the line idea{module{inheritOutputDirs = true}} but I didn't run again the ./gradlew setupDecompWorkspace.

 

thanks for your help!

Is that not step 2?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

 

It works! I had already added the line idea{module{inheritOutputDirs = true}} but I didn't run again the ./gradlew setupDecompWorkspace.

 

thanks for your help!

Is that not step 2?

no. Step 2 indicates to launch the command not to add lines and than relaunch the command.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Oh I forgot to update the title. I figured out the issue and I'm rather embarrassed to say that it was a file path issue. The game already knew I was accessing the achievements so I wasn't suppose to include advancements in the file path. Minecraft file paths have always confused me a little bit... ResourceLocation advancementId = new ResourceLocation( TheDeadRise.MODID,"adventure/spawntrigger");
    • Can someone help my with this? My forge server won't open and I'm not that good with this stuff. It gave me this error message:   C:\Users\apbeu\Desktop\Forge server>java -Xmx4G -Xms1G -jar server.jar nogui 2024-12-11 18:21:01,054 main WARN Advanced terminal features are not available in this environment [18:21:01] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.2.34, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, nogui] [18:21:01] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 8.1.3+8.1.3+main-8.1.x.c94d18ec starting: java version 21.0.4 by Oracle Corporation Exception in thread "main" java.lang.IllegalAccessError: class cpw.mods.modlauncher.SecureJarHandler (in unnamed module @0x402e37bc) cannot access class sun.security.util.ManifestEntryVerifier (in module java.base) because module java.base does not export sun.security.util to unnamed module @0x402e37bc         at cpw.mods.modlauncher.SecureJarHandler.lambda$static$1(SecureJarHandler.java:45)         at cpw.mods.modlauncher.api.LamdbaExceptionUtils.uncheck(LamdbaExceptionUtils.java:95)         at cpw.mods.modlauncher.SecureJarHandler.<clinit>(SecureJarHandler.java:45)         at cpw.mods.modlauncher.Launcher.lambda$new$6(Launcher.java:55)         at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)         at cpw.mods.modlauncher.api.TypesafeMap.computeIfAbsent(TypesafeMap.java:52)         at cpw.mods.modlauncher.api.TypesafeMap.computeIfAbsent(TypesafeMap.java:47)         at cpw.mods.modlauncher.Environment.computePropertyIfAbsent(Environment.java:62)         at cpw.mods.modlauncher.Launcher.<init>(Launcher.java:55)         at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)         at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63)         at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60)         at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) C:\Users\apbeu\Desktop\Forge server>pause
    • Here is the url for the crash report if anyone can help me, please. https://mclo.gs/KGn5LWy  
    • Every single time I try and open my modpack it crashes before the game fully opens and I don't know what is wrong. I open the crash logs but I don't understand what any of it means. What do I do?
    • Hey, sorry I haven't said anything in a while. I was banned on here for sending you straight up crash logs and they banned me for spam... but I learned that these forums are for forge only and I was working with neoforge... but thank you for all the help.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.