Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
foxfen64 opened this issue Jul 23, 2022 · 1 comment
Open

Comments

@foxfen64
Copy link

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
Copy link
Owner

fischmat commented Aug 22, 2022

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:

  • Install the MSI Center (the link on that page doesn't work - you need to search for it in the Microsoft Store)
  • Within this "awesome" app, install Mysic Light
  • Start your IDE as administor (such that your runs have admin privileges)
  • Make sure that you placed the DLLs in the right locations. The argument to MysticLightAPI#initialize(Path) should point to the project root.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants