Repository navigation
Conversation
mperor
marked this pull request as ready for review
November 9, 2026 07:23
|
@mperor ⏰ This daily topic is still waiting for your review. |
4 similar comments
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What you'll learn
java GreetingMain.java(the source-code launcher) automatically finds and compiles a sibling.javafile it references, with no explicitjavacstep and no build fileWhy it matters
JEP 458 makes small, multi-class scripts and prototypes just as easy to run as a single-file program - handy for quick experiments, teaching examples, and utility scripts that don't warrant a full Gradle/Maven project.
Read more
JEP 458: Launch Multi-File Source-Code Programs
Quiz
A directory has
Main.java(which callsHelper.greet()) andBroken.java, which has a syntax error and is never referenced. Doesjava Main.javasucceed?Answer
Yes. The source-code launcher only compiles the files it actually needs to resolve references from the entry file, transitively - `Broken.java` is never compiled because nothing reaches it, so its syntax error has no effect.Note: tests were not run locally. The build requires a JDK 25 toolchain, which Gradle's foojay auto-provisioning tries to download from
api.foojay.io; that host is blocked by this environment's network policy, and no JDK 25 is otherwise installed here (only JDK 21). The multi-file resolution logic and expected output were verified locally with the available JDK by compiling the sibling files explicitly and running the resulting classes; the single-file-launcher invocation itself (java GreetingMain.java, auto-resolvingGreeter.java) is a JDK 22+ capability that could not be exercised directly in this environment. Opening as a draft so CI (which runs on JDK 25) can verify.Closes #113