How to install the embedded JVM on target?

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
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!

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)