0

I have a project that uses GraphStream (http://graphstream-project.org/) it's just a normal project (not Maven or Gradle). I seem to be able to include GraphStream, but whenever I try to make a .jar file Error: A JNI error has occurred, please check your installation and try again appears. I've tried to make a .jar file without it and it seems to work just fine, but it's crucial to have it there since it draws a graph at the end of the execution.

Could GraphStream be too old for usage? Is there a way to bypass this? Any help would be appreciated. I am using IntelliJ Community Version.

I've tried making an uber-jar (or fat-jar) but the same error seems to appear.

Here are all of the classes and the .jar file classes and the .jar file

Here are the dependencies of the GraphStream (downloaded via Maven).

dependencies

And this is the problem that I get whenever I try to run the .jar in IntelliJ. enter image description here

  • Include the two jars in the lib folder in your classpath and read https://stackoverflow.com/questions/1082580/how-to-build-jars-from-intellij-properly and https://spring.io/guides/gs/intellij-idea/ – Sully May 01 '20 at 18:12
  • @HithamS.AlQadheeb did the exact same thing, still the same problem. I am pretty much sure I've tried this before too. –  May 01 '20 at 18:20
  • Please share the [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – CrazyCoder May 01 '20 at 18:21
  • @CrazyCoder maybe the edit will be of some help? –  May 01 '20 at 18:34
  • 1
    Yes, it does, see https://stackoverflow.com/a/45169655/104891. – CrazyCoder May 01 '20 at 18:36
  • Bouncycastle libraries you have embedded have the digital signatures. I'm not sure there is an easy way having a fat jar with these security libs (bc*). See https://github.com/johnrengelman/shadow/issues/227. – CrazyCoder May 01 '20 at 18:51
  • @CrazyCoder removing those signature helped! Thank you a lot. Although I am facing another problem now - Whenever I run the .jar file from IntelliJ it works fine, GraphStream works and it shows the things I need. However, when I run it directly from the .jar file (without IntelliJ) GraphStream doesn't seem to run. –  May 01 '20 at 19:06
  • Make sure command line has the same options and the same JDK version is used. – CrazyCoder May 01 '20 at 19:08

0 Answers0