我已经安装了ubuntu 14.04.02 x64,oracle jdk 1.8.4,我尝试运行JavaFX8项目,但是我在eclipse中收到这个消息(不是每次都是):
# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f69a19a4f78, pid=7035, tid=140090187572992 # # JRE version: Java(TM) SE Runtime Environment (8.0_40-b25) (build 1.8.0_40-b25) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b25 mixed mode linux-amd64 compressed oops) # Problematic frame: # V [libjvm.so+0x6c3f78] jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x38 # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x00007f699c28a800): JavaThread "JavaFX Application Thread" [_thread_in_vm, id=7057, stack(0x00007f6949cde000,0x00007f6949ddf000)] siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000 Registers: RAX=0x00007f6949dd9b70, RBX=0x00007f6949dd9a80, RCX=0x0000000000000001, RDX=0x3b746e6576456e6f RSP=0x00007f6949dd98d0, RBP=0x00007f6949dd9a50, RSI=0x00007f6949dd9ae0, RDI=0x00007f699c28a9f8 R8 =0x00007f699c1e3f28, R9 =0x00007f6949dd9a80, R10=0x0000000000000011, R11=0x00007f698d1fb000 R12=0x00007f699c28a800, R13=0x00007f699c1e3f28, R14=0x0000000000000001, R15=0x00007f699c28a9f8 RIP=0x00007f69a19a4f78, EFLAGS=0x0000000000010206, CSGSFS=0x0000000000000033, ERR=0x0000000000000000 TRAPNO=0x000000000000000d Top of Stack: (sp=0x00007f6949dd98d0) 0x00007f6949dd98d0: 00007f6949dd9f30 00007f698cdf8768 0x00007f6949dd98e0: 00007f6949dd9930 00007f6949dd99b0 0x00007f6949dd98f0: 00007f6949dd9a80 00007f6949dd9ae0 0x00007f6949dd9900: 00007f699c28a9f8 00007f69a19c4810 0x00007f6949dd9910: 00007f6960011a60 00007f6960011ae0 0x00007f6949dd9920: 00007f6960011e48 00000000000003d8 0x00007f6949dd9930: 00007f69880d4f08 00000000d8954d60 0x00007f6949dd9940: 000000000000006f 000000000000000a 0x00007f6949dd9950: 00000000d8c35188 00007f6900000000 0x00007f6949dd9960: 0000000000000000 00007f6949dd9a20 0x00007f6949dd9970: 00007f699c217040 0000000100000140 0x00007f6949dd9980: 00007f69880d4f08 00007f6949dd9938 0x00007f6949dd9990: 00007f6949dd9979 0000000800000005 0x00007f6949dd99a0: 00007f69880d4f00 00007f699c28a800 0x00007f6949dd99b0: 00007f69a2220590 00007f69a2d03470 0x00007f6949dd99c0: 00000000d8954a78 00007f69880d4f08 0x00007f6949dd99d0: 0000000000000000 00007f699c28a800 0x00007f6949dd99e0: 00007f69880dee68 00007f699c28a800 0x00007f6949dd99f0: 00007f69880dee68 00007f699c28a800 0x00007f6949dd9a00: 00007f6949dd9a50 00007f69880dee68 0x00007f6949dd9a10: 00007f69880dee68 00007f69880dee68 0x00007f6949dd9a20: 00007f699c28a9f8 00007f6949dd9a80 0x00007f6949dd9a30: 00007f699c28a800 00007f6949dd9ac0 0x00007f6949dd9a40: 00007f699c1e3f28 00007f699c28a9f8 0x00007f6949dd9a50: 00007f6949dd9b40 00007f69a19a971f 0x00007f6949dd9a60: 00007f699c28a800 00007f697eedcfc4 0x00007f6949dd9a70: 00007f6949dd9b50 3b746e6576456e6f 0x00007f6949dd9a80: 00007f69a22211f0 00007f69a2d03470 0x00007f6949dd9a90: 000000009c217040 0000000000000063 0x00007f6949dd9aa0: 0000000000000000 0000003000000018 0x00007f6949dd9ab0: 00007f6949dd9c30 00007f6949dd9b70 0x00007f6949dd9ac0: 00007f699c28a800 0000000000000000 Instructions: (pc=0x00007f69a19a4f78) 0x00007f69a19a4f58: 00 00 48 85 d2 48 89 bd b0 fe ff ff 48 89 b5 a8 0x00007f69a19a4f68: fe ff ff 4c 89 8d a0 fe ff ff 0f 84 10 09 00 00 0x00007f69a19a4f78: 4c 8b 22 4d 85 e4 0f 84 04 09 00 00 48 8b 45 10 0x00007f69a19a4f88: 48 8b 98 38 01 00 00 48 83 7b 18 f7 0f 87 06 06 Register to memory mapping: RAX=0x00007f6949dd9b70 is pointing into the stack for thread: 0x00007f699c28a800 RBX=0x00007f6949dd9a80 is pointing into the stack for thread: 0x00007f699c28a800 RCX=0x0000000000000001 is an unknown value RDX=0x3b746e6576456e6f is an unknown value RSP=0x00007f6949dd98d0 is pointing into the stack for thread: 0x00007f699c28a800 RBP=0x00007f6949dd9a50 is pointing into the stack for thread: 0x00007f699c28a800 RSI=0x00007f6949dd9ae0 is pointing into the stack for thread: 0x00007f699c28a800 RDI=0x00007f699c28a9f8 is an unknown value R8 =0x00007f699c1e3f28 is an unknown value R9 =0x00007f6949dd9a80 is pointing into the stack for thread: 0x00007f699c28a800 R10=0x0000000000000011 is an unknown value R11=0x00007f698d1fb000 is at entry_point+32 in (nmethod*)0x00007f698d1fae90 R12=0x00007f699c28a800 is a thread R13=0x00007f699c1e3f28 is an unknown value R14=0x0000000000000001 is an unknown value R15=0x00007f699c28a9f8 is an unknown value Stack: [0x00007f6949cde000,0x00007f6949ddf000], sp=0x00007f6949dd98d0, free space=1006k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x6c3f78] jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x38 V [libjvm.so+0x6c871f] jni_CallVoidMethodV+0x10f C [libglass.so+0x1b798] JNIEnv_::CallVoidMethod(_jobject*, _jmethodID*, ...)+0x98 C [libglass.so+0x19355] WindowContextBase::process_key(_GdkEventKey*)+0x225 C [libglass.so+0x22bf0] WindowContextBase::im_filter_keypress(_GdkEventKey*)+0x1f0 C [libglass.so+0x254d4] process_events(_GdkEvent*, void*)+0x204 C [libgdk-x11-2.0.so.0+0x591ec] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.sun.glass.ui.gtk.GtkApplication.enterNestedEventLoopImpl()V+0 j com.sun.glass.ui.gtk.GtkApplication._enterNestedEventLoop()Ljava/lang/Object;+15 j com.sun.glass.ui.Application.enterNestedEventLoop()Ljava/lang/Object;+14 j com.sun.glass.ui.EventLoop.enter()Ljava/lang/Object;+42 j com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(Ljava/lang/Object;)Ljava/lang/Object;+107 j javafx.stage.Stage.showAndWait()V+74 j javafx.scene.control.HeavyweightDialog.showAndWait()V+11 j javafx.scene.control.Dialog.showAndWait()Ljava/util/Optional;+41 j classes.LoginDialog.showLoginDialog()V+10 j controller.MainWindowController.buttAdministratorAction(Ljavafx/event/ActionEvent;)V+22 v ~StubRoutines::call_stub j sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 J 856 C1 sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (10 bytes) @ 0x00007f698d0ed304 [0x00007f698d0ed200+0x104] J 855 C1 java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (62 bytes) @ 0x00007f698d0ecd44 [0x00007f698d0ec960+0x3e4] j sun.reflect.misc.Trampoline.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+7 j sun.reflect.GeneratedMethodAccessor1.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+40 J 856 C1 sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (10 bytes) @ 0x00007f698d0ed304 [0x00007f698d0ed200+0x104] J 855 C1 java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (62 bytes) @ 0x00007f698d0ecd44 [0x00007f698d0ec960+0x3e4] j sun.reflect.misc.MethodUtil.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+20 j javafx.fxml.FXMLLoader$MethodHandler.invoke([Ljava/lang/Object;)V+19 j javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Ljavafx/event/Event;)V+12 j com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Ljavafx/event/Event;)V+51 J 1483 C1 com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Ljavafx/event/EventType;Ljavafx/event/Event;)Ljavafx/event/Event; (34 bytes) @ 0x00007f698d29fb94 [0x00007f698d29f640+0x554] j com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Ljavafx/event/Event;)Ljavafx/event/Event;+8 j com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Ljavafx/event/Event;)Ljavafx/event/Event;+11 j com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Ljavafx/event/Event;Ljavafx/event/EventDispatchChain;)Ljavafx/event/Event;+29 J 1433 C1 com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Ljavafx/event/Event;)Ljavafx/event/Event; (101 bytes) @ 0x00007f698d288ec4 [0x00007f698d288d20+0x1a4] j com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Ljavafx/event/Event;Ljavafx/event/EventDispatchChain;)Ljavafx/event/Event;+17 J 1433 C1 com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Ljavafx/event/Event;)Ljavafx/event/Event; (101 bytes) @ 0x00007f698d288ec4 [0x00007f698d288d20+0x1a4] j com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Ljavafx/event/Event;Ljavafx/event/EventDispatchChain;)Ljavafx/event/Event;+17 J 1433 C1 com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Ljavafx/event/Event;)Ljavafx/event/Event; (101 bytes) @ 0x00007f698d288ec4 [0x00007f698d288d20+0x1a4] j com.sun.javafx.event.EventUtil.fireEventImpl(Ljavafx/event/EventDispatchChain;Ljavafx/event/EventTarget;Ljavafx/event/Event;)Ljavafx/event/Event;+10 j com.sun.javafx.event.EventUtil.fireEvent(Ljavafx/event/EventTarget;Ljavafx/event/Event;)Ljavafx/event/Event;+37 j javafx.event.Event.fireEvent(Ljavafx/event/EventTarget;Ljavafx/event/Event;)V+30 j javafx.scene.Node.fireEvent(Ljavafx/event/Event;)V+86 j javafx.scene.control.Button.fire()V+15 j com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Ljavafx/scene/input/MouseEvent;)V+23 j com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Ljavafx/scene/input/MouseEvent;)V+83 j com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Ljavafx/event/Event;)V+5 j com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Ljavafx/event/Event;)V+5 j com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Ljavafx/event/Event;)V+28 J 1483 C1 com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Ljavafx/event/EventType;Ljavafx/event/Event;)Ljavafx/event/Event; (34 bytes) @ 0x00007f698d29fb94 [0x00007f698d29f640+0x554] j com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Ljavafx/event/Event;)Ljavafx/event/Event;+8 j com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Ljavafx/event/Event;)Ljavafx/event/Event;+11 j com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Ljavafx/event/Event;Ljavafx/event/EventDispatchChain;)Ljavafx/event/Event;+29 J 1433 C1 com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Ljavafx/event/Event;)Ljavafx/event/Event; (101 bytes) @ 0x00007f698d288ec4 [0x00007f698d288d20+0x1a4] j com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Ljavafx/event/Event;Ljavafx/event/EventDispatchChain;)Ljavafx/event/Event;+17 J 1433 C1 com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Ljavafx/event/Event;)Ljavafx/event/Event; (101 bytes) @ 0x00007f698d288ec4 [0x00007f698d288d20+0x1a4] j com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Ljavafx/event/Event;Ljavafx/event/EventDispatchChain;)Ljavafx/event/Event;+17 J 1433 C1 com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Ljavafx/event/Event;)Ljavafx/event/Event; (101 bytes) @ 0x00007f698d288ec4 [0x00007f698d288d20+0x1a4] j com.sun.javafx.event.EventUtil.fireEventImpl(Ljavafx/event/EventDispatchChain;Ljavafx/event/EventTarget;Ljavafx/event/Event;)Ljavafx/event/Event;+10 j com.sun.javafx.event.EventUtil.fireEvent(Ljavafx/event/EventTarget;Ljavafx/event/Event;)Ljavafx/event/Event;+46 j javafx.event.Event.fireEvent(Ljavafx/event/EventTarget;Ljavafx/event/Event;)V+30 j javafx.scene.Scene$MouseHandler.process(Ljavafx/scene/input/MouseEvent;Z)V+491 j javafx.scene.Scene$MouseHandler.access$1500(Ljavafx/scene/Scene$MouseHandler;Ljavafx/scene/input/MouseEvent;Z)V+3 j javafx.scene.Scene.impl_processMouseEvent(Ljavafx/scene/input/MouseEvent;)V+6 j javafx.scene.Scene$ScenePeerListener.mouseEvent(Ljavafx/event/EventType;DDDDLjavafx/scene/input/MouseButton;ZZZZZZZZZ)V+46 j com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run()Ljava/lang/Void;+438 j com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run()Ljava/lang/Object;+1 v ~StubRoutines::call_stub j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0 j com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$350()Ljava/lang/Void;+11 j com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$208.get()Ljava/lang/Object;+4 j com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Ljava/util/function/Supplier;)Ljava/lang/Object;+18 j com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Lcom/sun/glass/ui/View;JIIIIIIIZZ)V+103 j com.sun.glass.ui.View.handleMouseEvent(JIIIIIIIZZ)V+30 j com.sun.glass.ui.View.notifyMouse(IIIIIIIZZ)V+181 v ~StubRoutines::call_stub j com.sun.glass.ui.gtk.GtkApplication._runLoop(Ljava/lang/Runnable;Z)V+0 j com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(Ljava/lang/Runnable;Z)V+7 j com.sun.glass.ui.gtk.GtkApplication$$Lambda$41.run()V+12 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub
当我的应用程序运行这个代码:
ChangeRoot changeRoot = new ChangeRoot(Main.mainStage, CONSTANTS.ROOT_EMPLOYEE_WINDOW.string, "Employee panel", true); changeRoot.doFadingTransition(borderPane, CONSTANTS.FADE_OUT.value, CONSTANTS.FADE_IN.value);
..
public class ChangeRoot{ private boolean bChangeStageSize = true; private boolean bFadeStage = true; private String sNewTitle; private boolean bResizable; private Controller controller; private Stage primaryStage; private FXMLLoader loader; private Parent root; public ChangeRoot(Stage primaryStage, String sRoot, String sNewTitle, boolean bResizable){ this.primaryStage = primaryStage; this.bResizable = bResizable; this.sNewTitle = sNewTitle; loader = new FXMLLoader(getClass().getResource(sRoot)); try{ root = loader.load(); controller = loader.getController(); }catch(IOException exception){ ExceptionDialog exceptionDialog = new ExceptionDialog("Error while loading fxml file", exception); exceptionDialog.showAndWait(); } } /**************************** PUBLIC METHODS *******************************/ public Controller getController(){ return controller; } public void doFadingTransition(Pane actualPane, double fadeOutMillis, double fadeInMillis){ actualPane.setDisable(true); //fading out final DoubleProperty stageOpacity = Main.mainStage.opacityProperty(); final DoubleProperty oldPaneOpacity = actualPane.opacityProperty(); if(bFadeStage == true) oldPaneOpacity.bindBidirectional(stageOpacity); Timeline fadeOut = new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(oldPaneOpacity, 1.0)), new KeyFrame(new Duration(fadeOutMillis), e -> { if(bResizable == true) Main.mainStage.setResizable(true); else Main.mainStage.setResizable(false); if(bFadeStage == true) oldPaneOpacity.unbindBidirectional(stageOpacity); changeRootAndWindow(); fadeIn(fadeInMillis); }, new KeyValue(oldPaneOpacity, 0.0) )); fadeOut.play(); } public final void changeRoot(){ changeRootAndWindow(); } /**************************** PRIVATE METHODS *******************************/ private final void changeRootAndWindow(){ //it will do depending what was put to the constructor if(primaryStage.isMaximized() == true){ primaryStage.setMaximized(false); } primaryStage.getScene().setRoot(root); primaryStage.setTitle(sNewTitle); if(bChangeStageSize == true){ Main.mainStage.setHeight(controller.getMainPane().getPrefHeight() + 38); Main.mainStage.setWidth(controller.getMainPane().getPrefWidth() +16); } } private void fadeIn(double fadeInMillis){ if(controller == null){ ExceptionDialog exceptionDialog = new ExceptionDialog("insert controller class", new Exception()); exceptionDialog.showAndWait(); } final DoubleProperty newPaneOpacity = controller.getMainPane().opacityProperty(); final DoubleProperty stageOpacity = Main.mainStage.opacityProperty(); if(bFadeStage == true) newPaneOpacity.bindBidirectional(stageOpacity); Timeline fadeIn = new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(newPaneOpacity, 0.0)), new KeyFrame(new Duration(fadeInMillis), actionEvent -> { if(bFadeStage == true) newPaneOpacity.unbindBidirectional(stageOpacity); }, new KeyValue(newPaneOpacity, 1.0) )); fadeIn.play(); } }
================================================== ==========
它不是每次都发生,而是大部分.通常在我开始eclipse之后没有问题,第一次运行我的程序.
我在互联网上看了一下答案,并试过:
sudo unlink /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1
还有这个:
I've tried adding the the below line to the end of eclipse.ini, but Eclipse can't start at all: org.eclipse.swt.browser.DefaultType=mozilla I think there is some typo error, the line should be: -Dorg.eclipse.swt.browser.DefaultType=mozilla and this worked for me.
但没有什么帮助….我不知道该怎么办
编辑:
当我在Windows上运行相同的代码时,没有问题.
EDIT2
我发现当我使用这样的静态变量:
Stage primaryStage = Main.primaryStage; primaryStage.setMaximized(true);
这会导致错误.
首先,设置SWT的选项不会帮助您,当您正在寻找JavaFX问题. SWT仅在Eclipse内部使用. JavaFX应用程序作为新进程启动,并不会注意到SWT由同一台计算机上的另一个Java应用程序使用.
从堆栈跟踪,它看起来像一个本地事件循环(GtkApplication.enterNestedEventLoopImpl)检测到一个“按键”事件(process_events – > WindowContextBase :: process_key). JavaFX方面似乎有一个事件处理程序,因为代码接下来尝试调用一个void方法(JNIEnv _ :: CallVoidMethod),然后它崩溃.
我不知道静态场如何在这里有效果也是按键不是罕见的,所以这应该是经过良好测试的代码.
此外,JavaFX似乎使用Gtk 2(libgdk-x11-2.0.so.0),这意味着在Tt和Eclipse中导致无休止的问题的Gtk 3的主题是不可见的.但是,或许你或某人选择了比“Gtk 2”默认使用的“更好”的桌面主题.我建议:
>尝试将主题重置为默认值
>为您的Linux安装最新的补丁
>创建一个只包含问题的代码的精简版本.
>尝试为JavaFX运行一个“Hello World”应用程序和一些演示文稿.
>如果失败,尝试打开一个针对OpenJDK: https://bugs.openjdk.java.net/secure/Dashboard.jspa 的错误
代码日志版权声明:
翻译自:http://stackoverflow.com/questions/29519242/ubuntu-javafx-a-fatal-error-has-been-detected-by-the-java-runtime-environment