我想按照本指南{@ 1}}在Ubuntu x64上构建和运行Dalvik VM。
我的代码分支&主机是这样的:
PATH/TO/AOSP/dalvik/docs/hello-world.html
首先,我在Ubuntu上建立Dalvik:
============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=4.2.1.2.4.8.16.32.64
TARGET_PRODUCT=full_x86
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=x86
TARGET_ARCH_VARIANT=x86
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.0.0-28-generic-x86_64-with-Ubuntu-11.10-oneiric
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
OUT_DIR=out
============================================
然后我编译Java代码并打包它。
之后我像这样运行它,但它失败了:
source build/envsetup.sh
lunch 2[full_x86-eng]
make dalvikvm core dexopt ext framework android.policy services
任何身体都可以提供一些线索吗?
日志如下:
guohai@KNIGHT:~/dev/src/android/git/aosp$ ./rund -cp Foo.jar Foo
答案 0 :(得分:1)
更改启动脚本的ANDROID_ROOT
后,它可以正常运行。
我的解决方法如下:
#!/bin/sh
# base directory, at top of source tree; replace with absolute path
base=`pwd`
# configure root dir of interesting stuff
root=$base/out/host/linux-x86
export ANDROID_ROOT=$root
# configure bootclasspath
bootpath=$base/out/target/product/generic_x86/system/framework
export BOOTCLASSPATH=$bootpath/core.jar:$bootpath/ext.jar:$bootpath/framework.jar:$bootpath/android.policy.jar:$bootpath/services.jar
export LD_LIBRARY_PATH=$bootpath/lib:$LD_LIBRARY_PATH
# this is where we create the dalvik-cache directory; make sure it exists
export ANDROID_DATA=/tmp/dalvik_$USER
mkdir -p $ANDROID_DATA/dalvik-cache
exec $root/bin/dalvikvm -Xdexopt:none $@