Java on Yocto 1.5 on i.MX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Java on Yocto 1.5 on i.MX6

9,096 Views
xstreamworship
Contributor II

Anyone build and running openjdk-7 in the yocto 1.5 environment on i.MX6?

 

I tried adding meta-java layer and ran 'bitbake openjdk-7' and it blows up in do_configure classpath-native.  The log file is attached.

 

I want to run this on my Wandboard-Quad.

 

Thanks in advance.

 

Darcy

Original Attachment has been moved to: log.do_configure.32494.classpath-native-0.99-r6.0.txt.zip

Labels (2)
13 Replies

2,151 Views
xstreamworship
Contributor II

FYI (and sorry about the long delay)

I did get this resolved a while back and have fired up openjdk7 in yocto 1.6 (daisy) since too.  Even recently ran tomcat8 with sample apps on it.

Thanks all

2,151 Views
sergioalmendros
Contributor II

Hello Darcy,

Could you explain how you made the "bitbake openjdk-7" command to work?, because I've been having the same problem.

Thanks,

Sergio.

0 Kudos

2,151 Views
xstreamworship
Contributor II

At present, there are two things you have to do.

1.  Pick a provider for the 'initial' java compiler, (either cacao or jamvm).  I forget which is which, but one works for Fedora 19 (or newer distros) but I have to use the other for CentOS 6.  There is a README file in meta-java that explains what you have to do.

2. Cd to where you have meta-java, then use 'git log' to find the hash for one commit back.  Then I back up the one commit.  The last commit changed paths to where it expects to find stuff, but the stuff being built is still where it was before (probably something got left out of that last commit).

Then it builds.  I have been using the master branch of meta-java with the daisy branch of yocto/openembedded.  Apart from a few quirks, it has been OK.  On some occasions when I change things, I have to clean out the built stuff and rebuild it from scratch.

Give this a try.  If not, I'll check it at work when I have the actual project in front of me.

Regards,

Darcy

0 Kudos

2,151 Views
sergioalmendros
Contributor II

First of all, I'm sorry if I ask silly questions, but I'm just starting with OpenEmbedded systems and it's little bit difficult to understand it all.


Is this the "meta-java" that you are talking: https://github.com/woglinde/meta-java?

Thanks,

Sergio.

0 Kudos

2,151 Views
OtavioSalvador
Senior Contributor II

Yes Sergio :-)

0 Kudos

2,151 Views
sergioalmendros
Contributor II

Thanks Otavio, I'm trying to do exactly what it says in the wiki (https://github.com/woglinde/meta-java/wiki), but it returns the following:

~/oe-core/build$ bitbake openjdk-6-jre

NOTE: Your conf/bblayers.conf has been automatically updated.

Parsing recipes: 100% |###############################################################| Time: 00:00:36

Parsing of 882 .bb files complete (0 cached, 882 parsed). 1274 targets, 66 skipped, 0 masked, 0 errors.

ERROR: Nothing PROVIDES 'openjdk-6-jre'

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Somebody knows how to fix this?


Thanks,

Sergio.

0 Kudos

2,151 Views
sergioalmendros
Contributor II

I used hob, and try to make an image "java-test-image", when I was building the packages it stopped. Then I tried again the command "bitbake openjdk-6-jre" and it appeared a different error:

bitbake openjdk-6-jre

Parsing recipes: 100% |###############################################################| Time: 00:00:48

Parsing of 1465 .bb files complete (0 cached, 1465 parsed). 1940 targets, 70 skipped, 0 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies

NOTE: multiple providers are available for jpeg (jpeg, libjpeg-turbo)

NOTE: consider defining a PREFERRED_PROVIDER entry to match jpeg

NOTE: multiple providers are available for runtime java2-runtime (cacao, jamvm, openjdk-7-jre, openjdk-6-jre)

NOTE: consider defining a PREFERRED_PROVIDER entry to match java2-runtime

NOTE: multiple providers are available for runtime java2-vm (openjdk-7-jre, openjdk-6-jre)

NOTE: consider defining a PREFERRED_PROVIDER entry to match java2-vm

NOTE: multiple providers are available for virtual/java-native (cacao-native, jamvm-native)

NOTE: consider defining a PREFERRED_PROVIDER entry to match virtual/java-native

NOTE: multiple providers are available for jpeg-native (jpeg-native, libjpeg-turbo-native)

NOTE: consider defining a PREFERRED_PROVIDER entry to match jpeg-native

NOTE: multiple providers are available for virtual/java-initial (cacao-initial, jamvm-initial)

NOTE: consider defining a PREFERRED_PROVIDER entry to match virtual/java-initial

Build Configuration:

BB_VERSION        = "1.23.1"

BUILD_SYS         = "x86_64-linux"

NATIVELSBSTRING   = "Ubuntu-12.04"

TARGET_SYS        = "x86_64-oe-linux"

MACHINE           = "qemux86-64"

DISTRO            = "nodistro"

DISTRO_VERSION    = "nodistro.0"

TUNE_FEATURES     = "m64 core2"

TARGET_FPU        = ""

meta              = "master:47d1fc9f5c38f3d092937c47bd4c2f45adaa7fe6"

meta-oe           = "master:8f637f9bbcdda1dc7a1998d243708c727aa6016f"

meta-java         = "master:d2b75b615e4612f9fa05950c1d76d4a719e573d4"

NOTE: Preparing runqueue

NOTE: Executing SetScene Tasks

NOTE: Executing RunQueue Tasks

ERROR: Function failed: do_compile (log file is located at /home/sergio/oe-core/build/tmp-eglibc/work/x86_64-linux/jaxp1.3-native/1.4.01-r0/temp/log.do_compile.10347)

ERROR: Logfile of failure stored in: /home/sergio/oe-core/build/tmp-eglibc/work/x86_64-linux/jaxp1.3-native/1.4.01-r0/temp/log.do_compile.10347

Log data follows:

| DEBUG: Executing shell function do_compile

| /home/sergio/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/javac: 9: /home/sergio/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/javac: java: not found

| WARNING: exit code 127 from a shell command.

| ERROR: Function failed: do_compile (log file is located at /home/sergio/oe-core/build/tmp-eglibc/work/x86_64-linux/jaxp1.3-native/1.4.01-r0/temp/log.do_compile.10347)

ERROR: Task 1580 (virtual:native:/home/sergio/oe-core/meta-java/recipes-core/xml-commons/jaxp1.3_1.4.01.bb, do_compile) failed with exit code '1'

NOTE: Tasks Summary: Attempted 598 tasks of which 593 didn't need to be rerun and 1 failed.

Waiting for 0 running tasks to finish:

Summary: 1 task failed:

  virtual:native:/home/sergio/oe-core/meta-java/recipes-core/xml-commons/jaxp1.3_1.4.01.bb, do_compile

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Thanks,

Sergio.

0 Kudos

2,151 Views
OtavioSalvador
Senior Contributor II

Yes; this seems like a bug.

You need to debug why this is failing. Seems like a missing native dependency.    

0 Kudos

2,151 Views
sergioalmendros
Contributor II

I did the process again and now it works, I don't know why. But now another error appears:

ERROR: Function failed: do_configure (log file is located at /home/sergio/oe-core/build/tmp-eglibc/work/core2-64-oe-linux/openjdk-6-jre/6b27-1.12.8-r22.4/temp/log.do_configure.25265)

ERROR: Logfile of failure stored in: /home/sergio/oe-core/build/tmp-eglibc/work/core2-64-oe-linux/openjdk-6-jre/6b27-1.12.8-r22.4/temp/log.do_configure.25265

ERROR: Task 5 (/home/sergio/oe-core/meta-java/recipes-core/openjdk/openjdk-6_6b27-1.12.8.bb, do_configure) failed with exit code '1'

ERROR: Function failed: do_configure (log file is located at /home/sergio/oe-core/build/tmp-eglibc/work/core2-64-oe-linux/openjdk-7-jre/25b30-2.3.12-r5.1/temp/log.do_configure.25266)

ERROR: Logfile of failure stored in: /home/sergio/oe-core/build/tmp-eglibc/work/core2-64-oe-linux/openjdk-7-jre/25b30-2.3.12-r5.1/temp/log.do_configure.25266

I don't know how to debug this process, I will try to learn, but it's probably a mistake on my part, so if anyone knows why this happened it would be a great help.

The logfile is attached.

Thanks,

Sergio.

0 Kudos

2,151 Views
OtavioSalvador
Senior Contributor II

Sorry but I have no clue offhand. Please dig into it and try to find out what is failing.

In case you want, we can offer professional support services at O.S. Systems and debug it.

0 Kudos

2,151 Views
xstreamworship
Contributor II

I have run into out-of-memory errors while building Yocto with java.  There are two config vars that are usually set to determine number of bitbake tasks and make threads that can run in parallel.  Usually they are set to double the number of processor cores in your build machine.  Go into your local config and cut them each in half.  I have one build machine with 4 cores and another with 2 cores, so they were set to 8 and 4 respectively.  So I cut them to 4 and 2.  These were on machines with 8Gb RAM.  If you have 16Gb, this may be unnecessary.  Some of the programs that run while bootstrapping the java like to malloc very large chunks of memory.  I am not sure if this will help you because I always ran into trouble while it was still building for native.

Two other issues I have had to deal with.  You have to choose between Cacao or JamVM to be used as an 'initial' compiler during early stage of the bootstrap.  I don't remember exactly which, but one works OK when building on CentOS 6 32bit but the other blows up.  But on my Fedora 19 64bit build host, it is the other way around.  So I have one set by default in a layer file, but override it to the opposite in the local config when I am building on the Fedora host (since it is a machine I use at home rather than at work).

You may also be affected by some vars mentioned in the readme file included with the meta-java layer.  Double check that you've got those all covered.

Then finally, if you are building daisy, but trying to use the master branch of the meta-java layer with it (because there is no daisy branch), you need to back out to the commit related to broken separator because the commit after that (something to do with install paths) isn't compatible with daisy branch.

Sorry I can't be more precise, I am writing from memory while on a Windows laptop rather than on one of the build hosts (and it's been a few weeks since I've run a build because we just moved my project office).

Regards,

Darcy

0 Kudos

2,151 Views
xstreamworship
Contributor II

Here are some things that I found need to be in your local config file...

# for 64bit build machine use…

PREFERRED_PROVIDER_virtual/java-initial = “cacao-initial”

# for 32bit build machine use…

PREFERRED_PROVIDER_virtual/java-initial = “jamvm-initial”

# for all, use…

PREFERRED_PROVIDER_virtual/java-native = “jamvm-native”

PREFERRED_VERSION_openjdk-7-jre = “25b30-2.3.12”

PREFERRED_VERSION_icedtea7-native = “2.1.3”

PREFERRED_PROVIDER_openjdk-7-jre = “openjdk-7-jre”

2,151 Views
LeonardoSandova
Specialist I

The last line on the attached log mentions a log file, have you inspect it?

Leo

0 Kudos