Unable to run jar file inside or outside IntelliJ
Answered
I can debug/run my application from the IntelliJ IDE without issues.
However no matter which method I use to create a jar ("extract to target jar" or "copy to output directory and link via manifest") the resulting jar file will not run from within the IDE or from the command line. I have spend quite a bit of time searching for solutions.
Are there any recent articles?
Version info:
IntelliJ IDEA 2017.3.5 (Ultimate Edition)
Build #IU-173.4674.33, built on March 6, 2018
JRE: 1.8.0_152-release-1024-b15 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Please sign in to leave a comment.
See http://stackoverflow.com/a/42200519/104891 and http://stackoverflow.com/a/42660624/104891.
Also check https://stackoverflow.com/a/45169655/104891.
In case the issue persists, share a sample project to reproduce.
Created a new Gradle project. Add the traditional "hello world" class. Runs fine in IDE. Running the artifact results in:
"C:\Program Files\Java\jdk1.8.0_161\bin\java" -Dfile.encoding=windows-1252 -jar xxx.jar
xxx.jar???????????????????
Update: I can get the jar to work as long as I do not use any of the IDE functions. Update build.gradle and run "gradlew jar" from the terminal.