2016-10-17 9 views
0

私はクラスのためのGUIプロジェクトを行う必要があり、私は書いているプログラムを実行することができません。ubuntu 14.04でSwingプログラムを実行できません

openjdk version "9-internal" 
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195526.buildd.src) 
OpenJDK Client VM (build 9-internal+0-2016-04-14-195526.buildd.src, mixed mode) 

I:

package start; 
/* 
* HelloWorldSwing.java requires no other files. 
*/ 
    import javax.swing.*;   

    public class HelloWorldSwing { 
    /** 
    * 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(); 
     } 
    }); 
    } 
} 

私はJavaコンパイラを持って、私は自分の端末上のjava -versionを使用する場合には、これを返すので、私は知っている、私は最も簡単なプログラムを実行しようとしたので、私はどこにでも見てきましたまた、JREを持っています。

私はそれをコンパイルし、私は (これは、コンパイルん)javac start/HelloWorldSwing.javaを使用するが、私はjava start.HelloWorldSwingでそれを実行しようとすると、それは、これを返します。

# A fatal error has been detected by the Java Runtime Environment: 
# 
# SIGSEGV (0xb) at pc=0xb6aafe48, pid=4166, tid=4180 
# 
# JRE version: OpenJDK Runtime Environment (9.0) (build 9-internal+0-2016-04-14-195526.buildd.src) 
# Java VM: OpenJDK Client VM (9-internal+0-2016-04-14-195526.buildd.src, mixed mode, serial gc, linux-x86) 
# Problematic frame: 
# C [libjava.so+0x18e48] JNU_GetEnv+0x18 
# 
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %P" (or dumping to /home/carcamo/Escritorio/myhw/core.4166) 
# 
# An error report file with more information is saved as: 
# /home/carcamo/Escritorio/myhw/hs_err_pid4166.log 
# 
# If you would like to submit a bug report, please visit: 
# http://bugreport.java.com/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 
# 

私は本当に私はこの問題に取得することができます任意の助けをいただければ幸いです

+1

Javaプログラム自体からではなく、JVMからのバグのように見えます。まだ実行していない場合は、Javaがそのマシンに再インストールされる可能性があります。そのマシンは破損している可能性があります。 –

+0

プログラムは、Oracleバイナリの9 ea b143(https://jdk9.java.net/download/)の最新バージョンで正常に動作します。 – Fairoz

答えて

0

サポートされているバージョンのJavaを使用してみましたか? openjdk 8を試してみるか、Oracle Java 8リリース(現在は8u102)をダウンロードしてください。

関連する問題