This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268774 - It should be possible to have a main class in an unnamed package.
Summary: It should be possible to have a main class in an unnamed package.
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-01 18:23 UTC by rachnagoel18
Modified: 2016-11-01 18:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rachnagoel18 2016-11-01 18:23:27 UTC
It should be possible to have a main class in an unnamed package.
I am  Working with JDK9 build . If I create a new project and add a new java class in *default* package..this project though compiles but does not run.

This is because it tries to call the generated jar as if it were an automatic module.
 output after clean and build on my machine is :

To run this application from the command line without Ant, try:
/Users/RachnaGoel/jdk/dev/build/macosx-x64/images/jdk/bin/java --module-path /Users/RachnaGoel/NetBeansProjects/JavaLibrary1/dist/JavaLibrary1.jar -cp /Users/RachnaGoel/NetBeansProjects/JavaLibrary1/dist/JavaLibrary1.jar newpackage.NewClass

As it is clear, we can not use --module-path when the jar contains a class in the unnamed package. This is an issue with Netbeans 21st october 2016 Dev build.