Bug 546992 - Run As > Java file for non-ICompilationUnit Java file with JDK 11
Summary: Run As > Java file for non-ICompilationUnit Java file with JDK 11
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.10   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2019-05-06 03:03 EDT by Mickael Istria CLA
Modified: 2019-05-06 04:18 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2019-05-06 03:03:54 EDT
JDK 11 introduces that we can simply run `java MyClass.java`, which is extremely pleasant for beginner or tests.
Ability to run any Java file that is *not* in a Java project with this command would be a nice addition to the IDE.
Comment 1 Mickael Istria CLA 2019-05-06 03:05:31 EDT
This also needs to apply for files that are external to the workspace.
Comment 2 Sarika Sinha CLA 2019-05-06 04:11:19 EDT
We did discuss about this it when Java 11 came up with this feature but we did not plan to work on this as in Eclipse file without project is of no use.
And there is already support of linking a outside java file in a Java Project.

If there is someone willing to work on this, we can look at it.
Comment 3 Mickael Istria CLA 2019-05-06 04:18:16 EDT
(In reply to Sarika Sinha from comment #2)
> We did discuss about this it when Java 11 came up with this feature but we
> did not plan to work on this as in Eclipse file without project is of no use.
> And there is already support of linking a outside java file in a Java
> Project.
> 
> If there is someone willing to work on this, we can look at it.

I can understand that.
My deep goal is to slowly make Java files usable without an explicit Java project. For the "run" (and maybe debug) part, this simple enough issue would make the job; for the edition part, it'd be another story (basically building "volatile" dummy Java project when opening a .java file that's not in a Java project, in order to provide some decent assistance).
However, I also cannot make it a priority at the moment.

As this specific feature seems simple enough, I'm adding the usual tags.