Error: A JNI error has occurred, please check your installation and try again in Maven Project in Eclipse EE

Viewed 956

I built this Java Project on GitHub by Creating a Maven Project in Eclipse IDE for Enterprise Java Developers Version: 2019-03 (4.11.0), Build id: 20190314-1200 and copying the pom.xml file and src folder into my project and updated the project with Maven. When I run the project as a Java Application in Tomcat$1 - org.apache.catalina.startup, I get this in the Console View:

Error: A JNI error has occurred, please check your installation and try again

I checked a lot of the other stackoverflow posts similar to this with this error message, and none of them worked. There are some that are within a different context.

Any help is appreciated.

1 Answers

I ran the jar file in command line and discovered that a classpath wasn't found, which is directed by the following code:

@PropertySource("classpath:aws.properties")

I added the needed file in src/main/resources in the project, which holds the following key/value pairs:

aws_access_key_id=...
aws_secret_access_key=...

That fixed that problem, leading to another error I won't discuss here.

Related