# Access Timer API from Java

**URL:** <https://forum.legato.io/t/access-timer-api-from-java/2441>\
**Category:** Uncategorized\
**Created:** [May 8, 2017, 9:56am UTC](https://forum.legato.io/t/access-timer-api-from-java/2441 "2017-05-08T09:56:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unhit](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/unhit/32/130_2.png) [@unhit](https://forum.legato.io/u/unhit)\
**Post date:** [May 8, 2017, 9:56am UTC](https://forum.legato.io/t/access-timer-api-from-java/2441/1 "2017-05-08T09:56:26Z")

</div>

I’d like to create Timer which accesses other legato API (let’s say GPIO) in new thread. When I do this with java.util.Timer I get error

```
May 8 08:39:26 fx30 user.emerg Legato: *EMR* | _UNKNOWN_[4803]/framework T=unknown | LE_FILENAME GetCurrentThreadPtr() 461 | Legato threading API used in non-Legato thread!
```

How can I make my custom thread “legato”? Documentation states I can use Thread Control API (le\_thread\_InitLegatoThreadData()), but… I cannot access that too.

---

<div class="post-metadata">

**Author:** ![kdunwoody](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/kdunwoody/32/500_2.png) [@kdunwoody](https://forum.legato.io/u/kdunwoody)\
**Post date:** [May 15, 2017, 10:58pm UTC](https://forum.legato.io/t/access-timer-api-from-java/2441/2 "2017-05-15T22:58:02Z")

</div>

Native Java support in Legato is an experimental feature, and is incomplete. So for the moment it is recommended to use the C API via JNI if you want to use Java.
