Arm Linux 系统如何实现java程序的运行

     Android现在因为工作关系没得玩了,这些日子涉及到了嵌入式Linux环境java运行环境的搭建,有点意思,分享一下:

   

      1)java常被说成跨平台语言,可以要在要让一套java程序能够既能在x86 windos上运行,有能在arm linux上运行 道不像说的那么容易;

      2)Oracle 发布了Java Embedded版本,其在ubuntu上还是很容易运行起来,环境搭建也很简单(自己上官网看看就明白),但是ubuntu arm版本稳定性太差,除非对ubuntu进行裁剪,这个工作量太大,结果未知,从项目角度看不可取;

      3)那就在裸linux上进行开发咯,运行java Embedded 需要Gnome 2.16以上,移植Gnome?,目前决定放低Gnome中的窗体管理器,只移植X windows(xserver或者xorg),经过实现证明这种方法是可行的

      4)现在的问题就变成了怎么移植arm 版本xorg了,下面中提供的连接,别想着分分钟就搞定了,还是进下心来,慢慢看,慢慢移植吧(有智能编译工具,需要修改调试才能通过);

编译主要用到了xorg官网提供的jhbuild工具进行编译,因为相关的库实在是太多了,超过60个
参看连接(比较多,看看会懂的):
http://www.x.org/wiki/CrossCompilingXorg
http://www.x.org/releases/X11R7.6/
http://www.x.org/releases/X11R7.6/doc/
http://www.x.org/wiki/JhBuildInstructions/
http://www.x.org/wiki/CrossCompilingXorgJhbuild/
http://www.x.org/wiki/
http://www.x.org/releases/X11R7.6/doc/man/man4/evdev.4.xhtml
http://cgit.freedesktop.org/xorg/util/modular/plain/xorg-7.6.modules
ftp://ftp.freedesktop.org/pub/mesa/older-versions/7.x/7.9/

6)嵌入式当然要用到鼠标,触摸屏等一些human咯,这里记得移植编译Xorg的时候,要把xf86-video-fbdev xf86-input-mouse xf86-input-void xf86-input-keyboard xf86-input-evdev这些组件给带上,要不到时可能光有组件没发操作

7)这里说说中文字库支持的问题,必须要编译xorg 的mode fontconfig才能支持中文字库,未在xorg config指定的情况下,字库的默认路径是/usr/shera/font下面放ttf、ttc字库,会在Xorg server启动时加载这些字库

8)编译的东西只要静下心来,总会搞定的,这里假设将编译好的xorg放在/opt/xorg-arm目录下,那么需要提示在/etc/profile中配置一下参数(我这里是基于freescal Imx6 自定制linux系统 用的fb0)

         export DISPLAY=:0.0
         export LD_LIBRARY_PATH=/opt/xorg-arm/lib

         然后在运行/opt/xorg-arm/bin/X&即可,x window 算是运行起来了

      9)触摸屏怎么办能,修改xorg.conf,不会那就看看这个吧http://www.x.org/releases/X11R7.6/doc/man/man5/xorg.conf.5.xhtml#heading8

           把我的配置xorg.conf贴出来,支持触摸屏,鼠标

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
EndSection

Section "InputDevice"
Identifier "touchscreen"
Driver "evdev"
Option "Device" "/dev/input/event0"
Option "Calibration" "38 1941 78 1939"
Option "Mode" "Absolute"
EndSection

Section "Device"
Identifier "builtin Default fbdev Device 0"
Driver "fbdev"
EndSection

Section "ServerFlags"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
Option "DPMS" "false"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "i.MX Accelerated Framebuffer Device"
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "touchscreen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

10)就说这些吧,关键点基本都说明,其他的需要自己花时间去研究,涉及到的方面有些多。

       

 

 

原文地址:https://www.cnblogs.com/AdiSky/p/4990582.html