I compiled my program into a jar file and my folder contains three files:
config.ini
NotifyService.bat
NotifyService.jar
In my NotifyService.bat:
java -jar NotifyService.jar
pause
When I double clicked on the bat
file,it will auto run the jar file for me on command prompt.I could run the jar file with no issues on my machine.I copied the exact same files and run it remotely on a different pc,also works with no issues.
Now I tried with a third machine and it throws an error:
Error:Invalid or corrupt jarfile NotfiyService.jar
when I tried to run it.
Is there anything I should be looking at to diagnose this issue?
From what I can tell,they all shared the same configuration settings and are all running on windows.
Edit:
So from further checking,it seems the working machines are running java 1.8 while the non-working machines are using 1.7. I guess this is the reason it does not recognize the jar file. Is there a way to use the 1.7 machine to run the 1.8 jar file?