1

I just finished writing my Java program and now I want to export it into an executable JAR for use. However, when I try to, I get a "JNI Error Has Occured" error, followed by "Java Exception Error." How would I create a JAR with all the dependencies? I checked the Manifest after execution and all that was included was the main class and manifest version. I'm using some obscure packages like the following:

import com.profesorfalken.jpowershell.PowerShell;
import com.profesorfalken.jpowershell.PowerShellNotAvailableException;
import org.w3c.dom.events.EventException;

These are in my JDK under libraries. How can I package my program into an executable JAR? I don't know Maven as well. If there is a better platform for doing this, like Eclipse or Netbeans, please let me know and I'll do it there.

So far on IntelliJ, even if I click on creating the JAR with dependencies, it doesn't... It also classifies the JAR as an "artifact."

Please help....

  • Does your app have native (.dll) dependencies? In this case packaging in a single jar would be tricky. – CrazyCoder Jun 21 '17 at 20:11
  • No it doesn't. The only dependencies are the JARs in the JDK. For example, the jpowershell.jar that is in the Java JDK. I got the JAR from online and placed it in the JDK. – Simmon Thind Jun 21 '17 at 20:19
  • In this case see http://stackoverflow.com/a/42200519/104891. But `JNI Error Has Occurred` suggests that there may be some native dependency. – CrazyCoder Jun 21 '17 at 20:20

0 Answers0