# Converting package level Java annotation to Kotlin

**URL:** <https://discuss.kotlinlang.org/t/converting-package-level-java-annotation-to-kotlin/10586>\
**Category:** Language Design\
**Created:** [November 30, 2018, 8:37am UTC](https://discuss.kotlinlang.org/t/converting-package-level-java-annotation-to-kotlin/10586 "2018-11-30T08:37:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aynum](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/aynum/32/5822_2.png) [@aynum](https://discuss.kotlinlang.org/u/aynum)\
**Post date:** [November 30, 2018, 8:37am UTC](https://discuss.kotlinlang.org/t/converting-package-level-java-annotation-to-kotlin/10586/1 "2018-11-30T08:37:29Z")

</div>

Is it possible to convert a package level Java annotation to Kotlin?

Java annotation (MyAnnotation.java):

```auto
package com.myexample.annotation;

@Retention(RUNTIME) @Target(PACKAGE)
public @interface MyAnnotation {

}

```

Application of annotation (package-info.java)

```auto
@MyAnnotation
package com.myexample

```

The following does not seem to work (although it does compile) - my annotation processor does not detected any of the classes in the package com.myexample:

MyAnnotation.kt

```auto
package com.myexample.annotation

@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.FILE])
@Retention(AnnotationRetention.SOURCE)
annotation class MyAnnotation

```

package-info.kt

```auto
@file:MyAnnotation
package com.myexample

import com.myexample.annotation.MyAnnotation

```
