好吧,所以我几乎不能用"Snap“、"Snappy”或"Snapd“这几个术语搜索Java和Swing。但是我想知道是否可以使用Snap运行Java应用程序。
当我安装生成的snap,然后尝试运行应用程序时,它会立即返回而不需要任何输出。
我正在使用x11插头/接口。
作为一个快速和简单的测试,我还使用了与快照示例源相关的java世界,修改了一个简单的"hello“Swing源代码。
package oata;
import javax.swing.*;
public class HelloWorld {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("HelloWorldSwing");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Add the ubiquitous "Hello World" label.
JLabel label = new JLabel("Hello World");
frame.getContentPane().add(label);
//Display the window.
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}编辑:好的,所以重新启动解决了我的off快照/ubuntu核心状态问题。我现在回到没有GUI,没有输出。I 已经分叉管理器并修改了演示示例。。
当前快照接口输出:
matta@mirkwood:/work/Dev/snapcraft/examples/java-hello-world$ snap interfaces
Slot Plug
:firewall-control -
:home -
:locale-control -
:log-observe -
:mount-observe -
:network -
:network-bind -
:network-control -
:network-observe -
:opengl -
:snapd-control -
:system-observe -
:timeserver-control -
:timezone-control -
:unity7 -
:x11 java-hello-world发布于 2016-05-04 00:01:43
https://askubuntu.com/questions/764496
复制相似问题