After I do the initial project setup and run it is throwing this error at me
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:1046)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.initializeGlfw(Lwjgl3Application.java:88)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:138)
at com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)
Caused by: java.lang.IllegalStateException: GLFW may only be used on the main thread and that thread must be the first thread in the process. Please run the JVM with -XstartOnFirstThread. This check may be disabled with Configuration.GLFW_CHECK_THREAD0.
at org.lwjgl.glfw.EventLoop.<clinit>(EventLoop.java:30)
... 4 more
I tried adding adding the jvm argument as said here to my build.gradle file under run task, but It keeps throwing the same error at me.
I don't know if this is a m1 mac issue but It works fine for my friend, who is a windows user.
To add jvm arguments to VSCode, go to Run > Add Configurations on the VSCode window
In the launch.json file, add "vmArgs": "-XstartOnFirstThread"
Related
I have a testing application running as expected when executed on Eclipse IDE.
We want to export it to a jar and execute it via command line.
After executing, and running the application with the following comand, i encounter an error
java -jar testclient.jar -info
Error: Unable to initialize main class testclient.Main
Caused by: java.lang.NoClassDefFoundError: org/junit/runners/model/InitializationError
( -info) is an argument for the main method in the class.
Manifest file is pointing to the correct class.
On research of this topic, i checked whether the required libraries are added to the path. They are correctly added.
Could anyone provide some guidance
i'm trying to launch the minecraft client using eclipse for Minecraft 1.8.9 mods, but when I try to launch client, I get:
'Launching Client' has encountered a problem.
Variable references empty selection: ${project_loc}
does anybody know what could be causing this or how to fix it?
edit: if It helps at all, i have created a github repo with my code here
edit #2:
I selected the correct folder as pointed out by a comment, but now It does this:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit
then in console it says:
Unrecognized option: -Xincgc
I am using Netbeans to create a java application. The program works fine when I hit run in Netbeans. The problem is when I build the app and run it from the dist folder it throws the UnsatisfiedLinkError. I know this is caused by the libraries.
The error message is:
"Exception in thread "main" java.lang.UnsatisfiedLinkError:
jssc.SerialNativeInterface.openPort(Ljava/lang/String;Z)J"
Thank you for your help.
First of all, I have a basic example of OpenCV running in a main method.
However, if I use OpenCV in a Spring Web Controller, an error is thrown.
I am getting an UnsatisfiedLinkError when running the following code inside a Tomcat Server, within STS (Spring Tool Suite), and have boiled the problem down to the following code:
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
CascadeClassifier cascadeClassifier = new CascadeClassifier();
The run configurations of both the server and the "main" application contain the VM Arguments pointing to the OpenCV DLLs:
-Djava.library.path="C:\opencv\build\java\x64;C:\opencv\build\x64\vc10\bin"
For reference, I have also included the pertinent bits of the stacktrace below:
org.springframework.web.util.NestedServletException: Handler processing failed;
nested exception is
java.lang.UnsatisfiedLinkError: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0()J
...
Caused by: java.lang.UnsatisfiedLinkError:
org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0()J
at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0(Native Method)
at org.opencv.objdetect.CascadeClassifier.<init>(CascadeClassifier.java:38)
at com.immersion.test.controllers.SimpleController.createClassifier(SimpleController.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
Note: I have read in several StackOverflow threads that the main cause of the UnsatisfiedLinkError is the missing System.loadLibrary(Core.NATIVE_LIBRARY_NAME) call. This is clearly not the case here, since it is being called just above where the exception is thrown.
Same thing here.
I try what Dylan said, but did not work here.
But I added "C:\opencv\build\java\x64;C:\opencv\build\x64\vc10\bin" on my PATH variable. On my sys variables.
ps: I'm using windows.
It turns out that the default run configuration to start a Tomcat server within STS/Eclipse is essentially just a launcher for Tomcat.
This means that any VM Args that are added to the Tomcat 'run configuration' will not be transferred to the actual Tomcat instance.
On looking in tcruntime-instance.bat within the Tomcat directory (this is what ends up creating the tomcat java instance), we can see that simply by adding our intended VM Args to the JAVA_OPTS environment variable, the dlls will be available to Tomcat.
TL;DR:
So.. Simply add the the locations of the OpenCV binaries to your JAVA_OPTS environment variable:
-Djava.library.path="C:\opencv\build\java\x64;C:\opencv\build\x64\vc10\bin"
For more information on setting JAVA_OPTS for Tomcat, see this SO question.
I encountered a java.lang.NoSuchMethodError when running a program.
This link explained the error very clearly.
I am trying to debug this exception in Eclipse Kepler. The link recommends setting the JVM options -Dibm.cl.verbose=[class name], and -verbose:dynload.
I set these options under Run As -> Run Configurations -> Arguments -> VM arguments.
However, after setting the options the JVM is not outputting any additional debug information.
Exception in thread "main" java.lang.NoSuchMethodError: [package].Argument.getConsole()Lcom/beust/jcommander/internal/Console;
Why is the JVM not outputting the expected debug information?
According to the code on this page : https://github.com/cbeust/jcommander/blob/master/src/main/java/com/beust/jcommander/WrappedParameter.java
Jcommander can throw a NoSuchMethodException itself if you've led it to expect a list (that should have a 'put' method) but give it a type that doesn't have that method.
[SOLVED]
So it was a conflict with some dependency issue. Basically I had Maven version 1.17 and 1.30 somehow. I deleted the older one and the problem was resolved.