无法启动Java / Lanterna程序

时间:2013-02-11 08:56:52

标签: java linux chef headless lanterna

我正在编写一个小型终端应用程序,使用我发现的非常酷的Java库:Lanterna。它允许我使用与Swing类似的概念编写类似ncurses的应用程序。

由于应用程序ultumate目标是在服务器上运行,我在Vagrant ubuntu框上测试它。不幸的是,在每次启动时,我都会收到以下错误:

vagrant@precise64:~/myProject/target$ java -jar myProject-1.1.0-SNAPSHOT.jar -Djava.awt.headless=true
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jvm/jdk1.6.0_37/jre/lib/amd64/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1003)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1028)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
        at java.awt.Toolkit.<clinit>(Toolkit.java:1627)
        at java.awt.Font.<clinit>(Font.java:210)
        at com.googlecode.lanterna.terminal.swing.TerminalAppearance.createDefaultNormalFont(TerminalAppearance.java:46)
        at com.googlecode.lanterna.terminal.swing.TerminalAppearance.<clinit>(TerminalAppearance.java:33)
        at com.googlecode.lanterna.terminal.swing.SwingTerminal.<init>(SwingTerminal.java:77)
        at com.googlecode.lanterna.TerminalFacade.createSwingTerminal(TerminalFacade.java:115)
        at com.googlecode.lanterna.TerminalFacade.createSwingTerminal(TerminalFacade.java:104)
        at com.googlecode.lanterna.TerminalFacade.createTerminal(TerminalFacade.java:95)
        at com.googlecode.lanterna.TerminalFacade.createTerminal(TerminalFacade.java:65)
        at com.googlecode.lanterna.TerminalFacade.createTerminal(TerminalFacade.java:54)
        at com.googlecode.lanterna.TerminalFacade.createScreen(TerminalFacade.java:247)
        at com.googlecode.lanterna.TerminalFacade.createGUIScreen(TerminalFacade.java:261)

我想我的Java安装存在问题,该问题来自使用此配置的Chef solo Java配方

    chef.json = {
        :java => {
            :install_flavor => "oracle",
            :oracle => {
                "accept_oracle_download_terms" => true
            }               
        },
        :maven => {
            :version => '3',
            :setup_bin => 'true'
        }
    }

但我该如何解决?

1 个答案:

答案 0 :(得分:3)

libXtst.so附带一个名为libxtst6的包;而不是在debian。检查是否安装了该软件包,也许厨师不会自动安装该软件包。

祝你好运