# How to install the embedded JVM on target?

**URL:** <https://forum.legato.io/t/how-to-install-the-embedded-jvm-on-target/2968>\
**Category:** Legato Application Framework\
**Created:** [January 17, 2018, 11:52am UTC](https://forum.legato.io/t/how-to-install-the-embedded-jvm-on-target/2968 "2018-01-17T11:52:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fjanicki](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/fjanicki/32/320_2.png) [@fjanicki](https://forum.legato.io/u/fjanicki)\
**Post date:** [January 17, 2018, 11:52am UTC](https://forum.legato.io/t/how-to-install-the-embedded-jvm-on-target/2968/1 "2018-01-17T11:52:56Z")

</div>

I am trying to build a Java application for the legato Framework and I am developing using a Mangoh Red. I am able to run the HelloWorldJava sample but only if I embed the runtime, making it a 45M application. Is there a way to install the JVM on target for all applications? I am not finding any information on the subject. I tried using “onTargetJvm”, the application builds and installs but whenever I try to run it, it fails since the JVM is not present by default. I am looking on how to install it on my device.

I also tried running the Java IPC sample in this thread: [Communication between a Java Agent and a C application with Legato](http://forum.legato.io/t/communication-between-a-java-agent-and-a-c-application-with-legato/2485)  
But since it uses ANT and a Makefile, I don’t seem to have the option to even embed the JDK like I can using Developer Studio. I am a bit lost.

Thank you!

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/daav/32/64_2.png) [@daav](https://forum.legato.io/u/daav)\
**Post date:** [January 18, 2018, 6:19am UTC](https://forum.legato.io/t/how-to-install-the-embedded-jvm-on-target/2968/2 "2018-01-18T06:19:08Z")

</div>

Hi @fjanicki

As soon as you make your app depending on the “onTargetJvm” component, you need to:

- provision the JVM on the target. You can do it by uploading it to a writable folder (e.g. **/home/root/java** ). You can use the DS Filesystem view to do the upload thanks to a drag’n drop. Please pay attention to ensure that **xx/bin/java** gets the exec permission (can be done with Filesystem view as well).
- build your app by setting the **EJDK\_DIR** variable to the JVM path on the target (same path where you provisioned the JVM above)
