fischmat / mysticlight4j

Java Library for controlling MSI Mystic Light compatible LEDs
MIT License
7 stars 1 forks source link

A fatal error has been detected by the Java Runtime Environment: #12

Open ghost opened 2 years ago

ghost commented 2 years ago

Getting the below error after setting up the environment running the below code:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000000000000, pid=4244, tid=23540
#
# JRE version: Java(TM) SE Runtime Environment (16.0.1+9) (build 16.0.1+9-24)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0.1+9-24, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  0x0000000000000000
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\...\MysticLightTest\hs_err_pid4244.log
#
# If you would like to submit a bug report, please visit:
#   https://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.
#
import de.matthiasfisch.mysticlight4j.api.MysticLightAPI;

import java.nio.file.Path;

public class driver {

    public static void main(String[] args){
        MysticLightAPI.initialize(Path.of("MysticLightSDK"));
    }

}
fischmat commented 2 years ago

Hi @foxfen64 ,

sorry for the late reply. I also had this problem some time ago with the old Dragon Center installed. After I switched to the MSI Center, it works for me without problems so far.

I just tried it again on a fresh system. Here is what I did:

image

I used this snippet for testing

public class NativeAPIExample {
    public static void main(final String[] args) {
        final MysticLight4j ml = new MysticLight4j();

        final String devicesAndLeds = ml.getAllAvailableDevices().stream()
                .map(d -> String.format("%s: \n%s", d.getName(), getLEDList(d)))
                .collect(Collectors.joining("\n\n"));
        System.out.println(devicesAndLeds);
    }

    private static String getLEDList(Device dev) {
        final List<String> ledNames = dev.getLEDs().stream()
                .map(led -> String.format("\t%s", led.getName()))
                .collect(Collectors.toList());
        return String.join("\n", ledNames);
    }
}

I hope this helps at least a little.