Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » HelloWorld project not successful(HelloWorld project)
HelloWorld project not successful [message #1822053] Wed, 26 February 2020 11:17 Go to next message
Dieter Heußner is currently offline Dieter HeußnerFriend
Messages: 1
Registered: February 2020
Junior Member
I am a new user of Eclipse. Having successfully installed Eclipse (2019-12) on SuSE Linux with "Java1.8" preset, I followed the tutorial of the HelloWorld project by

    - opening the Java perspective
    - creating the HelloWorld project
    - creating the HelloWorld class including the statement "System.out.println("Hello World!");"
    - saving the project


When trying to run (run as) the project, the following error message came up:
Must declare a named package because this compilation unit is associated to the named module 'HelloWorld' HelloWorld.java /HelloWorld/src line 1 Java Problem

Hints:

    When creating the project, a module "module-info.java" was created automatically.
    There are no syntax errors in the source code of HelloWorld.java
    The online documentation is not up-to-date with the current Eclipse. For example, when entering "HelloWorld" as a project name, the warning came up that project names should start with a lower case letter though the online documentation suggests "HelloWorld". However this issue is of very little importance for me.


Questions:

    Which JDK should be used (I accepted the default Java 1.8 during installation)
    What should I add in my Eclipse configuration?


Any hints welcome to overcome / bypass the problem(s):

Best regards
Dieter



Re: HelloWorld project not successful [message #1822058 is a reply to message #1822053] Wed, 26 February 2020 13:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
The JRE used in your IDE will need to be one that supports modules, so needs to be Java 9 or higher. Use Window -> Preferences -> Java -> Installed JREs to Add... a reference to a Java 9 or higher installation of Java.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Starting Eclipse 4.14 with Java 11.0.6 on command Line --> Not Working : Need Help
Next Topic:New project not showing pydev
Goto Forum:
  


Current Time: Thu Mar 28 11:33:15 GMT 2024

Powered by FUDForum. Page generated in 0.04351 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top