I've a simple
maven project and which I have successfully packaged on the terminal (mvn package)
When executing the jar file it gives an error that a text file can't be found which contains the data to be read in.
I'm using OS X.
My project structure is:
NameOfProject
src
main
java
resources
data.txt
data2.txt
META-INF
MANIFEST.MF
The MANIFEST.MF contains:
Manifest-Version: 1.0
After running the jar file it gives the following error:
File could not be found file:/Users/Mike/Projects/NameOfProject/target/application-app-1.0-SNAPSHOT.jar!/data.txt (No such file or directory)Exception in
thread "main" java.lang.NullPointerException
When I run the application from my
ide it works fine.
When I look inside the jar file I can see both data.txt files.
I'm not sure but I see a
! at the end of the name of the jar file.
What causes this error and how can I solve this?