# How does lua call java packages and classes?

**URL:** <https://forums.solar2d.com/t/how-does-lua-call-java-packages-and-classes/348518>\
**Category:** Win32 Desktop\
**Created:** [September 11, 2018, 5:00pm UTC](https://forums.solar2d.com/t/how-does-lua-call-java-packages-and-classes/348518 "2018-09-11T17:00:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![284672641](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/2/71c47a/32.png) [@284672641](https://forums.solar2d.com/u/284672641)\
**Post date:** [September 11, 2018, 5:00pm UTC](https://forums.solar2d.com/t/how-does-lua-call-java-packages-and-classes/348518/1 "2018-09-11T17:00:57Z")

</div>

How does lua call java packages and classes? I read the contents of the following two links:  
[Https://www.cnblogs.com/mokey/p/4443561.html](https://www.cnblogs.com/mokey/p/4443561.html)  
[Https://blog.csdn.net/linfenliang/article/details/39374843](https://blog.csdn.net/linfenliang/article/details/39374843)  
Just write the code of how to call , there is no writing process, for example, just like lua calls c packaged dll library,like thes： you should first install vs2010, then use vs2010 to create a win32 console application project, named mylib (doesn’t matter)…, I have attached the process of corona to compile the external library windows in the attachment. Who knows how this process of lua how to call java packages and classes?

---

<div class="post-metadata">

**Author:** ![agramonte](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@agramonte](https://forums.solar2d.com/u/agramonte)\
**Post date:** [September 11, 2018, 7:33pm UTC](https://forums.solar2d.com/t/how-does-lua-call-java-packages-and-classes/348518/2 "2018-09-11T19:33:32Z")

</div>

I don’t have enough information to answer your specific question. But it doesn’t appear that the two articles you mentioned are related to Corona. Since&nbsp;this is a Corona forum I assume you are looking for Corona information. There&nbsp;is some information in the native documentation about calling java:

[https://docs.coronalabs.com/native/index.html](https://docs.coronalabs.com/native/index.html)

You can also look at many examples of other people’s project on GitHub. You will find my&nbsp;Smaato plugin there. My&nbsp;plugin is not finished and it intentionally only will load on Amazon devices, but you can see how I call the .jar from the Lua code.

[https://github.com/agramonte/smaato-corona-plugin](https://github.com/agramonte/smaato-corona-plugin)

---

<div class="post-metadata">

**Author:** ![agramonte](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@agramonte](https://forums.solar2d.com/u/agramonte)\
**Post date:** [September 11, 2018, 7:33pm UTC](https://forums.solar2d.com/t/how-does-lua-call-java-packages-and-classes/348518/3 "2018-09-11T19:33:32Z")

</div>

I don’t have enough information to answer your specific question. But it doesn’t appear that the two articles you mentioned are related to Corona. Since&nbsp;this is a Corona forum I assume you are looking for Corona information. There&nbsp;is some information in the native documentation about calling java:

[https://docs.coronalabs.com/native/index.html](https://docs.coronalabs.com/native/index.html)

You can also look at many examples of other people’s project on GitHub. You will find my&nbsp;Smaato plugin there. My&nbsp;plugin is not finished and it intentionally only will load on Amazon devices, but you can see how I call the .jar from the Lua code.

[https://github.com/agramonte/smaato-corona-plugin](https://github.com/agramonte/smaato-corona-plugin)
