You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Geertjan Wielenga (JIRA)" <ji...@apache.org> on 2018/09/26 13:27:00 UTC

[jira] [Commented] (NETBEANS-1304) Can't assign main class for modular project

    [ https://issues.apache.org/jira/browse/NETBEANS-1304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628782#comment-16628782 ] 

Geertjan Wielenga commented on NETBEANS-1304:
---------------------------------------------

Seems logical that you'd put your main class into a package that should not be accessible from another module. Whether or not that is in the spec, I'd recommend simply putting your main class in a package that you're not exporting.

> Can't assign main class for modular project
> -------------------------------------------
>
>                 Key: NETBEANS-1304
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-1304
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Project
>    Affects Versions: 9.0
>         Environment: Windows 10, 64-bit
> JDK 11
> NetBeans 9.0, 64-bit launcher
>            Reporter: Peter Hull
>            Priority: Major
>         Attachments: Project.zip, three.png
>
>
> If a Java modular project with a main class (i.e. one with public static main (...)) exports the class's package, the UI doesn't allow the main class to be chosen (when running for the first time, or via Run section of the project properties)
> Steps to reproduce:
> 1. Create a new project and choose java ... java modular project
> 2. Add a module and a package
> 3. Add a main class to that package
> 4. Export that package from the module's module-info.java
> 5. Press F6 to run.
> 6. A dialog appears saying the project does not have a main class set, but there are no classes presented in the Select the main class: list
> If step 4 is omitted, the class does appear in the list and the project can be run.
> See attached screen shot and zipped project file.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists