eclipse-jdt / eclipse-jdt/eclipse.jdt.core

Java25: Compact file in subfolders give package error

Open
#4,437 3 comments 0 reactions 1 assignee Claimed by @jarthana View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

Problem: I have installed Terurin JDK25 and Eclipse JDT Eclipse Java Development Tools 3.20.400.v20250923-2045 org.eclipse.jdt .
When I create a compact source file in the root directory of my Java project, with only a main(), there is no error reported in Eclipse. But if I create a compact source file in a subfolder (package), the JDT compiler give me an error about a missing package declaration (see picture)

Image

Expected: Eclipse should not give an error for compact source files in subfolders about missing package declaration and should let the program be run without error.

I am a teacher and I want to use compact source file to simplify the writing of Java programs for my students, but I want to be able to put the programs of each chapter in a different folder, and I think Eclipse should let me do that.

Thanks
Nicolas

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.