• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Confusing UnsatisfiedLinkError

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am still working on this same project for school,
I finished all of the code, now out of "nowhere" I can't compile I can't run ?

I am getting this error:


Exception in thread "main" java.lang.UnsatisfiedLinkError: no CumulusJC 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)



The JAR file its looking for is right where eclipse thinks it should be.
-classpath shows the JAR file
I set native library location to the JAR location as well...

still getting this same error?

at TESTER.main(TESTER.java:19)
(line 19)

(the first reference to the JAR)
any suggestions?
 
Ranch Hand
Posts: 179
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I haven't used Cumulus , but I think your problem relates to setting some resource paths in your environment variable . Check out this link

Vishal
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This error means that your Java program is trying to load a native library which it cannot find. If you're running on Windows, it's looking for a DLL named CumulusJC.dll.

When you start your Java program, you have to specify on the command line where the DLL is, like this:

java -Djava.library.path=C:\dir\that\contains\the\library com.mypackage.MyMainClass

If you're running your program from Eclipse, select Run / Run Configurations, and then in the Arguments tab specify the -Djava.library.path=C:\dir\that\contains\the\library.
 
Jonathan Caldwell
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!

Cumulus is a digital asset management software, its interesting; I am building extensions.

(well, I am trying)

This link sent me in the right direction.

It seems the poster and I are in a similar situation.

(except I'm not using Mac, and this is in reference to an older version of cumulus)

so I tried to add a VM argument to eclipse project, but now I get this error:


java.lang.NoClassDefFoundError: Files/Canto/Cumulus
Caused by: java.lang.ClassNotFoundException: Files.Canto.Cumulus
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

So maybe there are multiple problems?


since I am using eclipse, I am kind of weary of using command line to work around. (since I have tried similar things in the past, and eclipse seems to like to play on its own terms)



Thanks Again
*



 
Jonathan Caldwell
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just as a note of further confusion on my part; on Friday, this program was compiling.

I came back on Monday, and PATH ERROR overload!

Is it possible that there is something outside of my doing that could have caused this to happen?

*
*

Baffled

*
*

 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jonathan Caldwell wrote:java.lang.NoClassDefFoundError: Files/Canto/Cumulus
Caused by: java.lang.ClassNotFoundException: Files.Canto.Cumulus


This is a different error. It means that Java cannot find the class named Cumulus in the package Files.Canto.

Is your class really in a package named Files.Canto? (What does the package ...; statement at the top of your source file look like?)
 
Jonathan Caldwell
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No the class I am referencing is in a package called com.canto.cumulus I think. or is that the base class?


I have just been using "default package" in my eclipse project, that's a bad idea?


 
Jonathan Caldwell
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have really only been using eclipse as an error checker, and I have been building my ejp files using ant from command line. I know eclipse will do a lot of work for me, but I like to know whats going on. my end goal for this is to have an executable JAR file to run this first bit of code that generates some text files. maybe I can set my PATH(s) inside an xml file and do all of this outside eclipse?

IDKWTD

Thanks
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you running the program? From the command line, from Eclipse, or from a batch file? What is the exact command that is used to run the program?
 
Jonathan Caldwell
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from eclipse:

Run>Run as...>Java application


from command line:

javac TESTER.java
java TESTER.java

 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jonathan Caldwell wrote:
java TESTER.java



That's wrong. Assuming you have TESTER.class in your current directory, and assuming you didn't declare a package for your TESTER class (should really be Tester, by the way, to follow the convention), you would doo



You need to give the class name, not the .java file name and not the .class file name.
 
Jonathan Caldwell
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I am getting more lost.

It seems that I will have to set the Path every time before I run the program?
(if I use command line)


theoretically; if I could get eclipse to run the program, it would store that program's specific path?


also if I plan to export to an executable JAR how do I bring all of these other JAR files into the new all encompassing JAR?

(I know that eclipse has options for this, but I mean otherwise)


 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jonathan Caldwell wrote:Sorry, I am getting more lost.

It seems that I will have to set the Path every time before I run the program?
(if I use command line)



In general it's a good idea to set any environment variables or other startup options each time you start each application, rather than relying on some global setting. That way applications can be configured and run independently of each other and in different environments. Often this is done with a small batch or shell script that launches the app.
 
Jonathan Caldwell
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay now I see part of the problem. it is saying Files/Canto/Cumulus

because I told it to go to "Program Files/Canto/Cumulus" it doesn't like the space.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put the path with the space in it in double quotes.

Note: The java command, to run a Java program, wants a classname, not a file name / path as its argument.

If your program is in the default package (you don't have a package statement in it), and it's in C:\Program Files\Canto, then you need to put that directory in the classpath. Don't forget the -Djava.library.path=... if it needs to load the native library. The command would then be something like:

java -classpath "C:\Program Files\Canto" -Djava.library.path=C:\dir\that\contains\the\library Canto
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic