How to create a package-info.java file in netbeans?

can any authority tell me how to create a package-info.java file in netbeans, when I try to create a new java file called package-info to indicate package level annotation, the class name is not valid. thrown out

Thank you in advance

+4
source share
2 answers

The -info.java package is not the original java file.

The correct way is that when creating a new file, do not create a Java class file. Instead, create a Java package info file, also in the Java category. This will launch the Create New Java Package Information Wizard.

enter image description here

+5
source

This is not entirely correct. You can create a file under Other> Other> Empty File with the name package-info.java

You can post Javadoc comments for the package and the string "package":

/** * Here are some comments about this package. * Here is a comment linking to {@link java.lang.Object}. */ package packagename; 
+4
source

Source: https://habr.com/ru/post/1443773/


All Articles