0

I am using Netbeans 8.0 and want to import a third-party library including an annotation processor. To be specific, it is Google's contracts for java, but I am not sure if that matters. I included the library and configured the annotation processor under the project's properties.

Now, when I add the library to the project, for the import line of the package, Netbeans does not give an error, however, when I want to use the package (@Requires(...)), it tells me:

error in contract: package com.google.java.contract does not exist

Is that a problem that occurs more often with Netbeans or should I suspect that it is specific to the library I am trying to use?

madison54
  • 743
  • 2
  • 8
  • 19

1 Answers1

0

see Here for the solution. You will need to pass in the classpath, sourcepath and classoutput as compilerargs

Go to project properties -> Build -> compiling and in the Processor options add in

     com.google.java.contract.classpath
     com.google.java.contract.sourcepath
     com.google.java.contract.classoutput

Regards

Community
  • 1
  • 1
DanielJ
  • 245
  • 1
  • 2
  • 10