1

I'm running a java application by this command :

java -cp < FileName> < package name>

however, it shows

A JNI error has occurred... Exception ... NoClassDefFoundError: ...

this result is right below enter image description here

I've surveyed the post Adding external library to artifact jar in IntelliJ IDEA but still not sure how to solve it.

Here is my Project Structure page, but have no clue to extract the dependencies into the artifact. enter image description here

What should I do to fix this?

Alanight
  • 353
  • 2
  • 8
  • 23

1 Answers1

0

Done.

I've created a .jar before, and I kept that setting. After delete & re-add a new .jar file with "extract to the target JAR" option chosen, the .jar file produced could work. Thanks!

enter image description here

Alanight
  • 353
  • 2
  • 8
  • 23