我正在尝试在Yocto构建中添加Java安装。我想在我的嵌入式系统上运行我开发的Java应用程序,但是我无法正确安装Java。 当我尝试运行java时,我得到以下内容:
./java: No such file or directory
我用google搜索解决方案,发现我需要安装libc6 32位版本。 我继续修改我的local.conf文件,如下所示:
MACHINE ??= "intel-corei7-64"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_rpm"
SDKMACHINE ?= "x86_64"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"
CORE_IMAGE_EXTRA_INSTALL = " lib32-glibc"
CORE_IMAGE_EXTRA_INSTALL += "opencv opencv-samples libopencv-core-dev libopencv-highgui-dev libopencv-imgproc-dev libopencv-objdetect-dev libopencv-ml-dev"
但是我收到了这个错误:
Build Configuration:
BB_VERSION = "1.32.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal-4.8"
TARGET_SYS = "x86_64-poky-linux"
MACHINE = "intel-corei7-64"
DISTRO = "poky"
DISTRO_VERSION = "2.2.1"
TUNE_FEATURES = "m64 corei7"
TARGET_FPU = ""
meta
meta-poky
meta-yocto-bsp = "morty:924e576b8930fd2268d85f0b151e5f68a3c2afce"
meta-intel = "morty:6add41510412ca196efb3e4f949d403a8b6f35d7"
meta-oe = "morty:fe5c83312de11e80b85680ef237f8acb04b4b26e"
meta-intel-realsense = "morty:2c0dfe9690d2871214fba9c1c32980a5eb89a421"
Initialising tasks: 100% |#####################################################################################################################################################################################################| Time: 0:00:22
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: rmc-1.0-r0 do_package: QA Issue: rmc: Files/directories were installed but not shipped in any package:
/usr/lib
/usr/lib/librmclefi.a
/usr/lib/librsmpefi.a
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
rmc: 3 installed and not shipped files. [installed-vs-shipped]
ERROR: rmc-1.0-r0 do_package: Fatal QA errors found, failing task.
ERROR: rmc-1.0-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/dalben/WorkingBuild/poky/filec/tmp/work/corei7-64-poky-linux/rmc/1.0-r0/temp/log.do_package.16424
ERROR: Task (/home/dalben/WorkingBuild/poky/meta-intel/common/recipes-bsp/rmc/rmc.bb:do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2954 tasks of which 2937 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/dalben/WorkingBuild/poky/meta-intel/common/recipes-bsp/rmc/rmc.bb:do_package
Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
感谢任何帮助。
编辑:更新了问题here。
答案 0 :(得分:1)
为了您的信息,您需要做很多工作才能将Java放入图像中。
您当前的图像没有安装任何java相关程序,因为我在编译过程中没有看到meta-java
。
CORE_IMAGE_EXTRA_INSTALL
仅限OE Core images;因此,如果您有自己的图像配方,除非继承core-image.bbclass
以下是将“openjdk-7-jre”放入图片的示例:http://wiki.hioproject.org/index.php?title=OpenHAB:_WeMo_Switch
关键要素是:meta-java,meta-oracle-java 。
您需要将它们添加到conf/bblayers.conf
BBLAYERS = " \
${BSPDIR}/sources/meta-java \
${BSPDIR}/sources/meta-oracle-java \
"
在conf/local.conf
中,添加此行以安装openjdk-7-jre。
IMAGE_INSTALL_append = " openjdk-7-jre "
要添加更多内容,请查看https://layers.openembedded.org/layerindex/branch/master/layers/