简体   繁体   中英

JavaFX causing fatal SIGSEGV error

I am running java 8.131 on OsX 10.12.5

Using the following code

task.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
        @Override
        public void handle(final WorkerStateEvent event) {

        }
    });

seems to cause this error: https://pastebin.com/GbByfDeY

I have looked everywhere and can't seem to find a fix. The common answer is hardware issue and wait for java update. I am posting as a last restore. Thank you in advance.

One approach would be to add an InvalidationListener to the stateProperty of the Task . Testing this example on Mac OS X 10.12.5 with Java 1.8.0_131-b11, the following listener prints SUCCEEDED on the console.

    task.stateProperty().addListener((Observable o) -> {
        if (task.getState() == Worker.State.SUCCEEDED) {
            System.out.println(task.getState());
        }
    });

Testing the same example on the same machine, the following onSucceeded handler produces the same result.

    task.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
        @Override
        public void handle(final WorkerStateEvent event) {
            System.out.println(task.getState());
        }
    });

The underlying cause of the segmentation fault may be elsewhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM