-
Enhancement
-
Resolution: Fixed
-
P3
-
11, 12
-
b13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8216593 | 11-pool-oracle | Unassigned | P3 | Closed | Withdrawn |
See mail thread started on core-libs-dev, continued on compiler-dev
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-September/055437.html
http://mail.openjdk.java.net/pipermail/compiler-dev/2018-September/012427.html
The source launcher currently checks that the main class in the source file does not also exist on the application class path, to avoid the wrong one being used.
This can cause a surprise for people comparing explicit use of javac and java with the source launcher, when compiled files may be left in the current directory, and will need to be deleted.
For example,
javac HelloWorld.java
java HelloWorld
#
java HelloWorld.java
The policy about just checking for the presence of the main class on the application class path is also insufficient when the code also has nested or inner classes. It is also inconvenient to have to delete such files if they have been left around.
It would be better for the source launcher to prefer the classes declared in the source file over any found on the application class path.
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-September/055437.html
http://mail.openjdk.java.net/pipermail/compiler-dev/2018-September/012427.html
The source launcher currently checks that the main class in the source file does not also exist on the application class path, to avoid the wrong one being used.
This can cause a surprise for people comparing explicit use of javac and java with the source launcher, when compiled files may be left in the current directory, and will need to be deleted.
For example,
javac HelloWorld.java
java HelloWorld
#
java HelloWorld.java
The policy about just checking for the presence of the main class on the application class path is also insufficient when the code also has nested or inner classes. It is also inconvenient to have to delete such files if they have been left around.
It would be better for the source launcher to prefer the classes declared in the source file over any found on the application class path.
- backported by
-
JDK-8216593 JEP 330: may need to recompile in case of class file version mismatch
-
- Closed
-