java - executable jar file not running outside of the folder where I created it -


i created jar file in working folder

jar -cfe mrmc.jar mrmc *.class *.jar db statpack

and able double click jar file or run using java -jar mrmc.jar

but when copy jar file location, can no longer run it. got errors:

exception in thread "main" java.lang.nullpointerexeption

it seems jar file did not find files in resource folder db above.

thank you.

i see 2 possible reasons:

a) content of db directory not end in jar. unzip jar check inside. note: jar zipfile.

b) not referencing files classpath resource, file resource. check methods using, if based on classpath or on file system.

see question different ways load file: how should load files java application?


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -