Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import com.sun.tools.javac.code.Attribute to kotlin module?

I'm writing annotation processor in Kotlin. It works, but I can not import com.sun.tools.javac.code.Attribute class: Andtoid Strudio shows me it correctly, but during compilation I get Unresolved reference: tools at import line.

What I need to import?

Now this module imports only kotlin-stdlib and kotlinpoet.

like image 485
tse Avatar asked Mar 25 '18 06:03

tse


1 Answers

You need to add tools.jar from the JDK to the dependencies of your module:

compile files("${System.properties['java.home']}/../lib/tools.jar")
like image 139
yole Avatar answered Nov 05 '22 13:11

yole