Run jar file
The first question would be: Do you have Java installed (in the correct version)? IntelliJ comes bundled with Java, so it'll be able to run Java programs. However that bundled JDK isn't available to the OS as such.
Can you post the exact message(s) you get when you try to run "java -jar example.jar"?
Current IntelliJ should be bundled with Java 11. Do you have Java 11 installed in macOS? What happens if you enter "java --version" on the terminal? You should be able to install Java 11 with brew, if needed.
The other question would be: How did you create the .jar-file? If you're using e.g. Gradle to build. there are certain settings you need to create a runnable jar. You'll normally want to create a "fat jar", which includes all dependencies, so it can run on any machine without needing to install its dependencies first.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now