1

I recently installed Eclipse 2020-06 and am using JDK 10.0.2. I wanted to test Eclipse using a simple Hello world program:

    package eclispeTest;
    
    public class eclipseTest {
    
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            System.out.println("Hello");
        }
    
    }

But I get the error: Error occurred during initialization of boot layer java.lang.module.FindException: Module eclispeTest not found

One quick fix I see for this to delete the module-info.java file but when I do this I get the error: Error: Could not find or load main class eclispeTest.eclipseTest Caused by: java.lang.ClassNotFoundException: eclispeTest.eclipseTest

I saw one potential fix that told me to go to "Check your project build-path and enable specific output folders for each folder. Go one by one though each source-folder of your project and set the output folder that maven would use." from: Eclipse - java.lang.ClassNotFoundException

But I am new to Eclipse and have no idea what they are talking about.

I have also noticed that when I open the problems tab at the bottom of Eclipse there is one problem that is repeated about 8 times: Description Resource Path Location Type The project was not built due to "Failed to init ct.sym for C:\Program Files\Java\jre-10.0.2\lib\jrt-fs.jar". Fix the problem, then try refreshing this project and building it since it may be inconsistent eclispeTest Unknown Java Problem

Could someone help me figure out what I should try, with baby steps for how I should do it.

Thank you in advance.

PS in case it helps here is a picture of my Eclipse window after I try to run my code:

EDIT: I made a new java project and below is my java project cration window java project cration window (I still got the same error)

Royginald
  • 125
  • 1
  • 10
  • Did you check https://stackoverflow.com/questions/49520858/error-occurred-during-initialization-of-boot-layer-findexception-module-not-fou and https://stackoverflow.com/questions/53932777/error-occurred-during-initialization-of-boot-layer? – Arvind Kumar Avinash Jul 07 '20 at 19:00

1 Answers1

0

Fist of all, In order to work the line " System.out.println("Hello");"

you will require two classes

1)java.lang.System

2)java.io.PrintStream

using above two classes the code runs.you don't have to import these class,because JRE(Java Runtime Environment) automatically does for you.

If you are gettting this error

Error occurred during initialization of boot layer java.lang.module.FindException: Module eclispeTest not found

Which means You didn't setup your "Java project" properly with "JRE"


Let create new project to solve this problem

1)Open Eclipse IDE

2)click FILE (top left most)

3)New

4)java project

5)give you project name (make sure that- "use default location checkbox" clicked)

6)IN JRE section - select use an execution environment JRE(edition as required)

7)Then click finish

This would have solved your problem , go create a Class do your eclipseTest. This time it should work.

java project creation should look like this

abid ali
  • 71
  • 4
  • I tried remaking the file its just that after I hit finish a window popped up asking me to make a module but it had a default name so I just pressed enter. Then I copy and pasted the code and reran it and got the same error: `java.lang.module.FindException: Module eclipseTest1 not found` I added a snip of my project creation window for the new prject – Royginald Jul 08 '20 at 13:39
  • I guess its problem with workspace, first create following directory "C:\Users\RoyMc\eclipse-workspace", then at the time of creating project untick "use default location" and use the above created directory as "Location". – abid ali Jul 09 '20 at 13:06
  • close eclipse then open it, at Start it will ask you to choose workspace, just browse it to above created directory. – abid ali Jul 09 '20 at 13:08