UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor rakshata
Visitor
3,118 Views
Registered: ‎01-11-2018

Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )


Hi Everyone,
I am using Xilinx Evaluation Kit: ZC706 Board (which uses ZynQ 7000, OS: Petalinux)
I want to execute java application on this. Is it possible to run Java application in petalinux? Is there JDK available for Zynq 7000?

Regards
0 Kudos
23 Replies
Scholar hbucher
Scholar
3,108 Views
Registered: ‎03-22-2016

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

@rakshata  Any java binary for the ARM Cortex A9 will run on Zynq.

You might need time to get the dependencies sorted out though.

If your question is that is java part of the supported packages in Petalinux - I dont know.

You might run `petalinux-config -c rootfs` and search for it.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Moderator
Moderator
3,036 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @rakshata,

 

PetaLinux doesn't support OpenJDK. In Yocto world java is a separate meta layer. 

 

You can try this I have integrated in 2016.4 Yocto same procedure applies here.

 

============
Add OpenJDK:
============

Clone meta-java in petalinux project.

 

$ git clone -b morty git://git.yoctoproject.org/meta-java in <plnx-proj-root>/project-spec

Add meta-java to your bblayer in <plnx-proj-root>/build/conf/bblayers.conf

 

Add following lines to <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf file

 

# Java preferences.  Could also be in distro config.
PREFERRED_PROVIDER_virtual/java-initial = "cacao-initial"
PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"
PREFERRED_VERSION_openjdk-7-jre = "" //add right version
PREFERRED_VERSION_icedtea7-native = "" //add right version
PREFERRED_PROVIDER_openjdk-7-jre = "openjdk-7-jre"

Add Java packages to Image. petalinux-user-image.bb

 

IMAGE_INSTALL_append = "openjdk-7-jre openjdk-7-vm-jamvm openjdk-7-vm-cacao \
							classpath \
							classpath-common \
							classpath-examples \
							classpath-tools \
							jamvm \
							cacao \" 
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Xilinx Employee
Xilinx Employee
3,021 Views
Registered: ‎06-29-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

you can add layers in petalinux through petalinux-config --> Yocto-settings --> User layer

Visitor rakshata
Visitor
2,968 Views
Registered: ‎01-11-2018

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @sandeepg,
Thanks for the reply.
I followed the steps mentioned by you in the post but, I am getting the below error.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'jamvm' (but /home/sysadmin/bsp/xilinx-zc706-2017.4/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'jamvm' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['jamvm']
ERROR: Required build target 'petalinux-user-image' has no buildable providers.
Missing or unbuildable dependency chain was: ['petalinux-user-image', 'jamvm']

Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build project
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Since the <plnx-proj-root>/build/conf/bblayers.conf is auto generated, do I have to update this file to add meta layer.
I am new to petalinux and I dont have experience in adding meta layers. Requesting you to guide me.

Regards

0 Kudos
Visitor rakshata
Visitor
2,877 Views
Registered: ‎01-11-2018

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi All,
I am still facing this issue. Kindly requesting to help me to resolve this issue.
Regards
Moderator
Moderator
2,861 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @rakshata,

 

Sorry i have been swamped with work. 

 

I built the java images in 2017.4 petalinux. You can follow below steps.

 

Clone meta-java in petalinux project.

 

$ cd <plnx-proj-root>/project-spec
$ git clone -b morty git://git.yoctoproject.org/meta-java

Add layers in petalinux through petalinux-config --> Yocto Settings --> User Layers ---> user layer 0

Then add path to meta-java as ${proot}/project-spec/meta-java

Save, Exit and verify <plnx-proj-root>/project-spec/configs/config has user layer as shown below.

 

#
# User Layers
#
CONFIG_USER_LAYER_0="${proot}/project-spec/meta-java"

Add below content to <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf file

# Java preferences.

# 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"

# Set the provider
PREFERRED_PROVIDER_openjdk-7-jre = "openjdk-7-jre"

# Add Java packages to RootFS.
IMAGE_INSTALL_append = "openjdk-7-jre openjdk-7-vm-zero \
                 strace dropbear binutils \
                 classpath \
                 classpath-common \
                 classpath-examples \
                 classpath-tools \
"

Know Issue: You can see some build errors due to SRC_URI for java packages are taking too long time to download compared to other packages.

 

Download these packages and place in <plnx-proj-root>/build/downloads/

 

http://icedtea.wildebeest.org/hg/release/icedtea7-forest-2.1/hotspot/archive/a456d0771ba0.tar.gz
http://icedtea.wildebeest.org/hg/release/icedtea7-forest-2.1/jdk/archive/d7ecb57d3c61.tar.gz

 

Also I observed in meta-java the recipes are not fixed with QA warnings in morty release. You can report this to meta-java mailing lists.

 

xilinx-zc702-2017.4 $ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
INFO: bitbake petalinux-user-image
Parsing recipes: 100% |#######################################################################################################################################################################################################| Time: 0:00:34
Parsing of 2544 .bb files complete (0 cached, 2544 parsed). 3368 targets, 235 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |####################################################################################################################################################################################################| Time: 0:00:09
Checking sstate mirror object availability: 100% |############################################################################################################################################################################| Time: 0:01:17
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
fsbl-2017.4+gitAUTOINC+77448ae629-r0 do_compile: NOTE: fsbl: compiling from external source tree /proj/petalinux/released/Petalinux-v2017.4/petalinux-v2017.4_1214_2/petalinux-v2017.4-final/tools/hsm/data/embeddedsw
WARNING: openjdk-7-jre-99b00-2.6.5-r6.1 do_package_qa: QA Issue: ELF binary '/tmp/sandeepg/plnx/2017.4/xilinx-zc702-2017.4/work/cortexa9hf-neon-xilinx-linux-gnueabi/openjdk-7-jre/99b00-2.6.5-r6.1/packages-split/openjdk-7-vm-zero/usr/lib/jvm/java-7-openjdk/jre/lib/arm/server/libjvm.so' has relocations in .text [textrel]
NOTE: Tasks Summary: Attempted 4247 tasks of which 3487 didn't need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.
INFO: Copying Images from deploy to images
INFO: Creating images/linux directory
NOTE: copy to TFTP-boot directory is not enabled !!
[INFO] successfully built project
xilinx-zc702-2017.4 $

 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Visitor rakshata
Visitor
2,817 Views
Registered: ‎01-11-2018

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

@sandeepg : Thanks for the reply. I followed the steps mentioned by you and  successfully generated an image but,  I am unable to boot this compressed image. I am getting error.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

petalinux-boot --qemu -i /tftpboot/zImage
INFO: The image provided is a zImage
INFO: TCP PORT is free
INFO: Starting arm QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on   -serial /dev/null -serial mon:stdio -display none -kernel /home/sysadmin/bsp/java/jdk8/xilinx-zc706-2017.4/build/qemu_image.elf -gdb tcp::9000 -dtb /tftpboot/system.dtb  -net nic,vlan=1 -net user,vlan=1,tftp=/tftpboot -net nic -device loader,addr=0xf8000008,data=0xDF0D,data-len=4 -device loader,addr=0xf8000140,data=0x00500801,data-len=4 -device loader,addr=0xf800012c,data=0x1ed044d,data-len=4 -device loader,addr=0xf8000108,data=0x0001e008,data-len=4 -device loader,addr=0xF8000910,data=0xF,data-len=0x4    
Warning: vlan 0 is not connected to host network
rom: requested regions overlap (rom bootloader. free=0x00000000045c5fc8, addr=0x0000000000000000)
Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000d32).
Available machine support:
ID (hex)    NAME
ffffffff    Generic DT based system
ffffffff    ARM-Versatile Express
ffffffff    Xilinx Zynq Platform
Please check your kernel config and/or bootloader.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Kindly guide me.

Regards

0 Kudos
Moderator
Moderator
2,806 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @rakshata,

 

Did you try on ZC706 board?

 

Remember we don't own meta-java we can just help in porting different meta-layer. You need to take the ownership of booting the images. 

 

These are the different meta-layer we have tested from Xilinx. Anything outside this we can't guarantee the images will work.

 

https://github.com/Xilinx/yocto-manifests/blob/rel-v2017.4/default.xml 

 

One more suggestion is add this in platform-top.h and try booting on board.

 

#undef CONFIG_SYS_BOOTMAPSZ

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Visitor rakshata
Visitor
2,766 Views
Registered: ‎01-11-2018

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

@sandeepg: I will try it on the zc706 board.

I have one more doubt. If I want to build jdk8, what changes do I need to make.

Regards

0 Kudos
Visitor rakshata
Visitor
1,711 Views
Registered: ‎01-11-2018

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi Everyone,
Any help on building jdk8. What changes do I need to make in the conf files.

Regards
0 Kudos
Moderator
Moderator
1,707 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @rakshata,

 

Just replace jdk7 with 8 in previous instructions.

 

References:

http://git.yoctoproject.org/cgit/cgit.cgi/meta-java/tree/recipes-core/openjdk?h=morty

http://git.yoctoproject.org/cgit/cgit.cgi/meta-java/tree/recipes-core/openjdk/openjdk-8_102b14.bb?h=morty 

https://git.yoctoproject.org/cgit/cgit.cgi/meta-java/about/

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Observer eliezer
Observer
311 Views
Registered: ‎03-21-2019

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Has anyone tried this in Petalinux 2019.1? I can't seem to clone meta-java:

fatal: unable to connect to git.yoctoproject.org:
git.yoctoproject.org[0: 140.211.169.56]: errno=Connection timed out

I can access git.yoctoproject.org just fine in my browser, is morty outdated or something?

0 Kudos
Scholar watari
Scholar
305 Views
Registered: ‎06-16-2013

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @eliezer 

 

Would you make sure firewall setting or proxy setting ?

I guess your network doesn't support git protocol or rejects git protocol on firewall or proxy server.

 

Best regards,

0 Kudos
Observer eliezer
Observer
272 Views
Registered: ‎03-21-2019

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Yeah I figured it might be something like that, company network.

0 Kudos
Observer eliezer
Observer
180 Views
Registered: ‎03-21-2019

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Turns out it was not just the firewall issue. The instructions from Sandeep were either incorrect or outdated.

To clone meta-java, I had to use this URL:

https://git.yoctoproject.org/git/meta-java

Notice the extra /git/ that was missing from Sandeep's instructions.

0 Kudos
Moderator
Moderator
164 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @eliezer ,

Looks like you are using https protocol to clone in this case yes you need additional /git refer http://git.yoctoproject.org/cgit/cgit.cgi/meta-java/ Clone section.

2019-11-11 19_06_31-meta-java - Layer containing recipes for OpenJDK and other open source Java- rel.png

 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Observer eliezer
Observer
131 Views
Registered: ‎03-21-2019

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Ah, thanks for explaining!

0 Kudos
Observer eliezer
Observer
117 Views
Registered: ‎03-21-2019

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

I was able to clone meta-java, and followed the instructions for openjdk-7. I am running into an error during the build process:

<project-root>/build/tmp/work/x86_64-linux/jamvm-native/2.0.0-devel+gitAUTOINC+6cef41d859-r0/recipe-sysroot-native/usr/bin/ecj-initial: line 9: java-initial: command not found
| Makefile:662: recipe for target 'classes.zip' failed
| make[6]: *** [classes.zip] Error 127

.....

ERROR: Task (virtual:native:<project-root>project-spec/meta-java/recipes-core/jamvm/jamvm_git.bb:do_compile) failed with exit code '1'

I can't find anyone else online who has had this particular problem. I assume it has to do with the zip files I downloaded being out of date?

 

EDIT: I am also seeing this warning message, for openjdk-7-jre, openjdk-8, and openjre-8:

WARNING: <project-root>/project-spec/meta-java/recipes-core/openjdk/openjre-8_102b14.bb: openjre-8 does not support aarch64 yet

Is the version of meta-java I downloaded not compatible with Aarch64?

0 Kudos
Moderator
Moderator
104 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @eliezer ,

Which version of petalinux are you using?

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Observer eliezer
Observer
100 Views
Registered: ‎03-21-2019

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

I am running 2018.3.

0 Kudos
Moderator
Moderator
89 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @eliezer ,

Are you using Zynq UltraScale+ MPSoC or Zynq-7000?

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Observer eliezer
Observer
72 Views
Registered: ‎03-21-2019

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Zynq UltraScale+ MPSoC.

After adding the Aarch64 port of OpenJDK to my build/downloads folder, I no longer see the "Aarch64 not supported" warning. I still run into the other error, though.

I notice that the build process for jamvm-native is taking place under the x86_64 folder, implying that it is not being built for aarch64.

0 Kudos
Moderator
Moderator
59 Views
Registered: ‎04-24-2017

Re: Is it possible to run Java application in petalinux (Xilinx Evaluation Kit: ZC706 Board )

Hi @eliezer ,

In theory Java has less support for AARCH64. It's open source community issue.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos