I've compiled the JAssimp library, and I'm trying to use the library in NetBeans with a project.
I'm setting the library path in Netbeans in the 'run' options of the project as such:
-Djava.library.path=D:\VB2013Projects\jassimpfinal\x64\Debug
That path is where jassimp.dll is located.
However, when I try to run my project, I get this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\VB2013Projects\jassimpfinal\x64\Debug\jassimp.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at jassimp.Jassimp.<clinit>(Unknown Source)
at opengltutorials.Mesh.loadMesh(Mesh.java:131)
at opengltutorials.Tutorial.init(Tutorial.java:124)
at opengltutorials.Tutorial.main(Tutorial.java:238)
I've checked the dependencies with Dependency Walker, and it shows that
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module. for jassimp.dll. However, it doesn't show any functions in red, so I think this is just a red herring (I am probably wrong, though).
What's going wrong with this?
Fixed this by putting the appropriate .dll's in the working directory.
Related
I've been working on the same problem for the past ~4 days: getting JAssimp to work (an Assimp port for Java). Before I ask this question, if ANYONE has got this to work and can provide any files, please do. I am so tired of messing with this.
Anyways, I've compiled two .dlls: jassimp.dll and assimp.dll (jassimp needs assimp.dll to work).
I've placed those in my project directory, and tried to run the project (obviously linking with jassimp.jar, built with ANT)
I get an error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\VB2013Projects\jassimpfinal\Debug\jassimp.dll: The specified procedure could not be found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1855)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at jassimp.Jassimp.<clinit>(Unknown Source)
at opengltutorials.Mesh.loadMesh(Mesh.java:131)
at opengltutorials.Tutorial.init(Tutorial.java:124)
at opengltutorials.Tutorial.main(Tutorial.java:238)
I checked the dependencies using dependency walker, and jassimp.dll shows like this:
What's happening here, and how can I fix this?
I'm attempting to create a Minecraft mod using the 1.7.2 release of MCP, version 9.03. I may be doing the installation steps wrong, as when I complete the installation, open Eclipse and select the workspace, it gives me 7 errors that I have no idea how to solve. These are the errors:
Project 'Client' is missing required library: 'jars/libraries/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar'
Project 'Client' is missing required library: 'jars/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar'
Project 'Client' is missing required library: 'jars/libraries/org/lwjgl/lwjgl/lwjgl- platform/2.9.0/lwjgl-platform-2.9.0-natives-windows.jar'
Project 'Server' is missing required library: 'jars/minecraft_server.1.7.2.jar'
Project 'Client' is missing required library: 'jars/libraries/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-windows.jar'
The project cannot be built until build path errors are resolved
The project cannot be built until build path errors are resolved
If I attempt to run without making any changes, this is the error that is displayed in the console:
Exception in thread "main" java.lang.NoClassDefFoundError: Start
Caused by: java.lang.ClassNotFoundException: Start
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Please help me out, I'm not using Forge as I plan to be making changes to base class files.
Open up eclipse and right click on the project "Client", go to build path, configure build path, click on all of the errored files and press remove. Then download the latest LWJGL (http://lwjgl.org/) and extract it to some folder, and import all of the jars. Next, get the natives for all platforms and put them in a new file called LWJGL-Natives.jar and import that as well.
Also, PLEASE do not do a base edit mod! It's bad practice, and will make your mod get little to no use. Try to use either the forge tweak utilities or the official one by mojang: https://github.com/Mojang/LegacyLauncher
Plus, you most likely can do whatever you want to do without ASM or base edits, so please try those before doing base edits.
For project "Server", remove the dependency for the broken resource. It will continue working fine.
Before anyone states duplicate. Please be aware that other questions are windows based and complain about DLLs or are not related to this library.
I have downloaded the EOCFI JAVA API from ESA which I would like to use. These include some example .java files.
I'm simply loading their entire API directory, adding the external JARs, and trying to run their examples. But I run into the following error:
java.lang.UnsatisfiedLinkError: no JCfiLib in java.library.path
I can't seem to find JCfiLib anywhere in the API or on the internet. I would imagine if I could I would simply add it to the java library path as the error states, but I have no idea what it is or where I can get it.
How can I get around this error?
I'm using eclipse on Debian Wheezy.
Any help would be greatly appreciated. Please be patient I'm not a Java programmer.
UPDATE (more details)
I realize now JCfiLib stands for "Java CFI Library" it's the library i'm using. But when I download it it's made up of 7 separate .jar files. (Visibility.jar, Pointing.jar, etc...) I reference them all as external jars.
The line it throws an error on is modelId = new ModelId(); (VisibilityExample.java:221)
error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no JCfiLib in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at EECFI.CfiId.<clinit>(CfiId.java:22)
at Visibility.example.VisibilityExample.main(VisibilityExample.java:211)
There are some native library (including a libJCfiLib.so) in the package I downloaded (linux64, in libraries/LINUX64) and you need to tell Eclipse where to find them:
see How to add native library to "java.library.path" with Eclipse launch (instead of overriding it) for example.
Also note that there are some sample provided in the package with "run script", you can also check those in order to help you with your project.
Hope that helps.
I am still unable to get the box-api hello world program to work. I was getting this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/NotImplementedException
at TestProgram.getAuthenticatedClient(TestProgram.java:47)
at TestProgram.main(TestProgram.java:35)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.NotImplementedException
...
I then went to the Apache Commons Lang Home and downloaded and set up their thing.
Now I get
Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
at com.box.boxjavalibv2.jacksonparser.BoxResourceHub.<init>(BoxResourceHub.java:28)
at com.box.boxjavalibv2.BoxClient.createResourceHub(BoxClient.java:345)
at com.box.boxjavalibv2.BoxClient.<init>(BoxClient.java:65)
...
and I have no idea how to fulfill that dependency. I also suspect that even if I could find this one, there'd just be another one, and another one, and another one. Manually importing them all does not seem to be very realistic.
How am I intended to get the missing dependencies for the box API?
The SDK comes included with all of the dependencies you should need. You can find them all in the libs directory of the SDK..
Add all of those jars to your Eclipse build path and it should work.
I'm developing a eclipse plugin rcp and I'm running into a NoClassDefFoundError
Exception in thread "Thread-7" java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
at org.geonames.WebService.search(WebService.java:783)
at geo.GeocoderGeonames$SearchThread.run(GeocoderGeonames.java:119)
Caused by: java.lang.ClassNotFoundException: org.jdom.input.SAXBuilder
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:483)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 2 more
The class that supposedly cannot be found is in a jar that I have added to the buildpath. I don't get any compile error etc only this exception when the running application enters the code where this class is needed...
Is there some other place I need to add the jar
After reading this added the jar to the MANIFEST.MF, which solved the problem.
As I understand it, eclipse starts several classloaders which only sees what MANIFEST.MF tells them to see and ingnores the build path...
How are you running your plug-in? You may need to add the JAR to the class path in the VM arguments.
In our experience a NoClassDefFoundError can sometimes mean that more than one version of a Class are found, as there is also a ClassNotFoundException that's normally thrown if a class cannot be found.
Another reason in your case (XML parser) might be something with endorsed classes. Are you directly importing the jdom classes or something like org.w3c...? If so, have a look at the "endorsed classes" system of Java, something that I just recently came across.