Update:
Upon further investigation, it is the Project Properties settings that
is causing this error. So, my question has changed...
How do I enable the annotation processor upon compilation for my
project? I added it to the Compiler section:
When I clicked on the "Add" button, only a small dialog popped up where
I typed in the FQCN, which is showing properly in the Annotation
Processors list. My annotation processor has no options that need to be
supplied to it, so that list should remain empty (as it is).
Do I need to make the module in which the annotation processor is
located open? I have successfully compiled the entire project, but still
am not able to use this processor on compile. What am I missing here?
All help is greatly appreciated!
-SC
On 10/22/23 20:03, Sean Carrick wrote:
Hey, All!
I have created an annotation to place application resources directly
into a class, and an annotation processor to process those annotations
into "Bundle.properties" and "Bundle.java" files in the same package
as the annotated class.
When I attempt to compile the file "ResourcesAnnotationProcess.java"
by right-clicking on the file and selecting "Compile File", I get the
following error:
ant -f /home/sean/NetBeansProjects/NTOS
-Dnb.internal.action.name=compile.single
-Djavac.includes=com/pekinsoft/res/proc/ResourcesAnnotationProcessor.java
compile-single
init:
Deleting: /home/sean/NetBeansProjects/NTOS/build/built-jar.properties
deps-jar:
Updating property file:
/home/sean/NetBeansProjects/NTOS/build/built-jar.properties
Compiling 14 source files to
/home/sean/NetBeansProjects/NTOS/build/modules
error: Annotation processor
'com.pekinsoft.res.proc.ResourcesAnnotationProcessor' not found
1 error
BUILD FAILED (total time: 0 seconds)
I cannot see any problems with the class definition:
public class ResourcesAnnotationProcessor extends AbstractProcessor
and the package and file names are correct.
This is a modular API that I am working on, and I do not want the
package the processor is in to be exported from the module. After
receiving this error, though, I thought that might be the issue, so I
added "exports com.pekinsoft.res.proc" to my module-info.java file,
and tried again to compile the file. I still got the same error.
My system configuration is as follows:
NetBeans 16 with JDK-17
MX Linux 23 (Kernel 6.1.0-10-amd64, KDE Plasma 5.27.5, Qt 5.15.8)
Intel Core i5-8265U CPU @ 1.60GHz
24 GiB RAM (Used: 5.7 GiB, Free: 17.6 GiB)
If any other information is needed to assist, please ask. Thanks for
any pointers!
-SC