cancel
Showing results for 
Search instead for 
Did you mean: 

Installing Java runtime on STM32MP157C-DK2

Puranjay Mohan
Associate II

I see that the page related to the installation on java is still under construction on the wiki, but I urgently want to install jre and want help in doing so.

I am using st-example-image-qt for my project and I need to add java to it, I have already added other packages like python, etc. using the IMAGE_INSTALL_append = python3, but when I add openjdk-7-jre in it after adding the meta-java layer, it gives an error that x11 is required in DISTRO_FEATURES.

Please help me fix this.

Thanks and Regards

1 REPLY 1
Olivier GALLIEN
ST Employee

Hi @Puranjay Mohan​ ,

Yes wiki page is currently in final review process and should be public very soon.

In the meantime, find below extract of main info :

JAVA for Linux-based system for embedded system is available as a meta data in Yocto project.

  • Clone following git repository into [your STM32MP1 Distribution path]/layers/meta-st/""
  PC >git clone git://git.yoctoproject.org/meta-java

Depending on the Yocto release, select the right branch. (example : branch dunfell for the ecosystem release v2.0.0 

The last commit tested is cf9604a4789801d9dfb0cb8ca134ff04b42ae161 : openjdk-8: remove -Werror

PC $>cd meta-java
PC $>git checkout  remotes/origin/dunfell 

If not done, setup your build environment:

PC $> cd [your STM32MP1 Distribution path]
PC $> source ./meta-st/script/envsetup.sh 
(Select for the DISTRO openstlinux-weston and for MACHINE stm32mp1)

Add the meta layer in your yocto environment :

PC $> cd [your STM32MP1 Distribution path]/build-openstlinuxweston-stm32mp1
PC $> bitbake-layers add-layer [your STM32MP1 Distribution path]/meta-st/meta-java

Define at least the following variables in your local.conf file.

([your STM32MP1 Distribution path]/build-openstlinuxweston-stm32mp1/conf/local.conf)
 
#Possible provider: cacao-initial-native and jamvm-initial-native
PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native"
 
#Possible provider: cacao-native and jamvm-native
PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
 
#Optional since there is only one provider for now
PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"

Include in your image the openjdk-8 component

PC $> cd [your STM32MP1 Distribution path]/meta-st/meta-st-openstlinux/recipes-st/images

Edit the file st-image-weston.bb and add the following line under CORE_IMAGE_EXTRA_INSTALL

 openjdk-8 \
  openjdk-8-demo \

Build the image

PC $> cd [your STM32MP1 Distribution path]/build-openstlinuxweston-stm32mp1
PC $> bitbake st-image-weston

Hope it help,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.