T Tobias Leininger Member Licensed User Longtime User Sep 16, 2020 #1 This code creates the following error in Release Mode but not in Debug Mode: Error: java.lang.ClassNotFoundException: org$bytedeco$javacv$Frame (The jar files are included in the Main Module with #AdditionalJar) Code: Copy Sub Class_Globals Private Frame As JavaObject End Sub Public Sub Initialize Frame.InitializeStatic("org.bytedeco.javacv.Frame") End Sub It's probably a noob error but any ideas what I'm doing wrong here? It works perfectly fine in Debug Mode. Full Error: java.lang.ClassNotFoundException: org$bytedeco$javacv$Frame at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:289) at anywheresoftware.b4j.object.JavaObject.InitializeStatic(JavaObject.java:75) at tt.hps3dprocessorui.realsense._initialize(realsense.java:201) at tt.hps3dprocessorui.main._appstart(main.java:92) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91) at anywheresoftware.b4a.BA.raiseEvent(BA.java:78) at tt.hps3dprocessorui.main.start(main.java:37) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:834)
This code creates the following error in Release Mode but not in Debug Mode: Error: java.lang.ClassNotFoundException: org$bytedeco$javacv$Frame (The jar files are included in the Main Module with #AdditionalJar) Code: Copy Sub Class_Globals Private Frame As JavaObject End Sub Public Sub Initialize Frame.InitializeStatic("org.bytedeco.javacv.Frame") End Sub It's probably a noob error but any ideas what I'm doing wrong here? It works perfectly fine in Debug Mode. Full Error: java.lang.ClassNotFoundException: org$bytedeco$javacv$Frame at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:289) at anywheresoftware.b4j.object.JavaObject.InitializeStatic(JavaObject.java:75) at tt.hps3dprocessorui.realsense._initialize(realsense.java:201) at tt.hps3dprocessorui.main._appstart(main.java:92) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91) at anywheresoftware.b4a.BA.raiseEvent(BA.java:78) at tt.hps3dprocessorui.main.start(main.java:37) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:834)
DonManfred Expert Licensed User Longtime User Sep 16, 2020 #2 Tobias Leininger said: Frame.InitializeStatic("org.bytedeco.javacv.Frame") Click to expand... You are missing an Import for org.bytedeco.javacv.Frame Add the jar with #AdditionalJar: Upvote 0
Tobias Leininger said: Frame.InitializeStatic("org.bytedeco.javacv.Frame") Click to expand... You are missing an Import for org.bytedeco.javacv.Frame Add the jar with #AdditionalJar:
T Tobias Leininger Member Licensed User Longtime User Sep 16, 2020 #3 But it is there (added with #AdditionalJar) and works in Debug Mode? Upvote 0
DonManfred Expert Licensed User Longtime User Sep 16, 2020 #4 I never use debug-mode, i can´t give any answer here. Based on the error i would say a dependency is missing. Check the dependencies here; there are a lot https://repo1.maven.org/maven2/org/bytedeco/javacv/1.5.4/javacv-1.5.4.pom Upvote 0
I never use debug-mode, i can´t give any answer here. Based on the error i would say a dependency is missing. Check the dependencies here; there are a lot https://repo1.maven.org/maven2/org/bytedeco/javacv/1.5.4/javacv-1.5.4.pom
T Tobias Leininger Member Licensed User Longtime User Sep 16, 2020 #5 I would think so too, but it's included and works in Debug Mode but not in Release Mode for some reason. I'm also confused as it shows $ instead of . in the error message: org$bytedeco$javacv$Frame vs org.bytedeco.javacv.Frame Upvote 0
I would think so too, but it's included and works in Debug Mode but not in Release Mode for some reason. I'm also confused as it shows $ instead of . in the error message: org$bytedeco$javacv$Frame vs org.bytedeco.javacv.Frame
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2020 #6 Does it work with Java 8? Might be related to the modules system introduced in Java 9. Upvote 0
T Tobias Leininger Member Licensed User Longtime User Sep 18, 2020 #7 So I tried many different versions and got it working by only including some of the libraries. I'm not really familiar with Java, but it looks like they load the platform specific libraries on runtime in JavaCV and that somehow doesn't work correctly. Now I've only included the library for one platform directly for each dependency and that works. What is the difference in Debug Mode vs. Release Mode related to included JARs that makes the behavior so different between the two? Upvote 0
So I tried many different versions and got it working by only including some of the libraries. I'm not really familiar with Java, but it looks like they load the platform specific libraries on runtime in JavaCV and that somehow doesn't work correctly. Now I've only included the library for one platform directly for each dependency and that works. What is the difference in Debug Mode vs. Release Mode related to included JARs that makes the behavior so different between the two?
Erel B4X founder Staff member Licensed User Longtime User Sep 20, 2020 #8 Tobias Leininger said: What is the difference in Debug Mode vs. Release Mode related to included JARs that makes the behavior so different between the two? Click to expand... Not enough information to say. Upvote 0
Tobias Leininger said: What is the difference in Debug Mode vs. Release Mode related to included JARs that makes the behavior so different between the two? Click to expand... Not enough information to say.