Bug 539007 - module-info.java for project with no src/bin layout is not shown in package explorer until refresh
Summary: module-info.java for project with no src/bin layout is not shown in package e...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.9   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-13 03:46 EDT by Holger CLA
Modified: 2023-08-24 07:46 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger CLA 2018-09-13 03:46:26 EDT
When creating a project with "Use project folder as root for sources and class files" (for teaching) the following message box occurs

Title: Create module-info.java
Message: No source folder exists in the project.

PS: Disabling the creation of the module-info.java #525374 also through (imported) Eclipse configurations would be very helpful.
Comment 1 Frederick Morrison CLA 2020-01-30 09:31:49 EST
I agree with the original submitter that this message needs to be suppressed under the specified circumstances. 

The desired result is a project that keeps .java and .class files in the project directory.

The resulting .classpath generated should be:

	<classpathentry kind="src" path=""/>
	<classpathentry kind="output" path=""/>
Comment 2 Stephan Herrmann CLA 2020-01-30 10:02:27 EST
I believe your original situation cannot be reproduced on recent versions of Eclipse (originally reported against 4.9), but I see the following:

- when creating a Java 9+ project with "Use project folder as root for sources and class files", the wizard does not offer to create module-info.java (why?)

- when manually creating module-info.java in the root of that project, the file remains invisible in the Package Explorer until you hit Refresh (or restart Eclipse or ...)

Apart from these issues, the setup works fine for me.

Do you observe differently on a recent Eclipse?
Comment 3 Holger CLA 2020-01-30 12:15:44 EST
I receive the same message on a 

Eclipse IDE for Java Developers
Version: 2019-09 R (4.13.0)
Build id: 20190917-1200

I'm happy if it is not present anymore no a newer version...
Comment 4 Stephan Herrmann CLA 2020-01-30 12:24:45 EST
I confirm the observations from comment 2 also hold for 2019-12 (4.14.0)

With this only invisibility of module-info.java is an outright bug, with lower priority, though.
Comment 5 Chris Mayfield CLA 2021-09-02 09:04:44 EDT
I have seen this same bug in the past several versions of Eclipse, including 2021-06 (4.20.0), on Linux, macOS, and Windows.

Steps to reproduce:

1. Create a new Java Project
2. Under "Project layout", select "Create separate folders..."

After pressing "Finish", a window titled "Create module-info.java" pops up with the error message "No source folder exists in the project." You can simply press OK, and everything works just fine. The error is unnecessary / confusing.
Comment 6 Chris Mayfield CLA 2021-09-02 09:07:24 EDT
Oops! For step #2 I meant to UN-select "Create separate folders". In other words, select the option to "Use Project folder as root..."
Comment 7 Eclipse Genie CLA 2023-08-24 07:46:10 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.