0

The title is everything I have. I tried two answers from previous users, but they didn't help me. Maybe I am too bad for this but I just can't get it working.

I'm currently trying my hands on modding Minecraft, and so I set up my workspace. Everything is fine but then I wanted to run it.

When running this is one of the Errors : Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_261 contains a valid JDK installation.

Thanks for everyone who will take their time and help me.

Edit: I will post screenshots of the things I forgot to post.

Java location

jdk 1.8.0 contents

jdk 12.0.1 contents

jre 1.8.0 contents

.gradle Folder contents

Edit 2:

After a new answer, I got a new problem.

This one seems quite different because its now saying: "Execution failed for task ':compileJava'."

Second Error in Eclipse

Second Error in Eclipse 2

Second Error in Eclipse 3

smaller
  • 1
  • 2

2 Answers2

0

You can try right click on your project name, then go to Build Path -> Preferences -> Configure Build Path ... Then in the "Libraries" tab, click on JRE, click edit and select the one you want for that specific project.

Miguel
  • 1
0

Your error message says, that you are using JRE instead of JDK and that seems to be your problem. You can change or check this in Eclipse Perferences.
In the menu bar click the following menu items: Window => Preferences
In the following Preferences window navigate like this: Java => Installed JREs

There you will see all JREs and JDKs, which eclipse knows.
Make sure that the list contains jdk-12 or jdk-8 by clicking the "Add..." button.
Select in this window the newly added JDK and click "Apply & Close".
Then it should work.

In my German blog, I have a post about how I setup and configure my Eclipse: https://agile-coding.blogspot.com/2020/09/eclipse-als-ide-fur-java-spring.html

Elmar Brauch
  • 1,286
  • 6
  • 20
  • This indeed helped in some way but sadly was not the answer. I also read through the blog since I am German but that didn't help either. I now get a new error, seems that the Old one is gone. The main post will be updated soon – smaller Oct 05 '20 at 20:53
  • The Post is Updated! I just didn't knew how to make a paste bin into a text there, weird problems – smaller Oct 05 '20 at 21:04
  • Based on the update, I think it is a gradle issue. You have to tell gradle, that it shall use JDK instead of JRE. I found this about setting JDK in gradle: https://stackoverflow.com/questions/18487406/how-do-i-tell-gradle-to-use-specific-jdk-version – Elmar Brauch Oct 05 '20 at 21:21
  • Thanks very much, the problem is that I don't know how to do any of those steps mentioned. I am really new to all of this, so I am sorry. – smaller Oct 06 '20 at 10:21