I am a beginner in developing Java desktop applications. I am trying to share the artifact with my colleague, but the .jar file does not launch on his PC.
I have IntelliJ, and JDK 14.0.1 installed in path C:\Program Files\Java\jdk-14.0.1. To generate artifact, I follow blog from JetBrains as below.
Create an artifact configuration for the JAR
From the main menu, select File | Project Structure
Ctrl+Shift+Alt+Sand click Artifacts.Click the Add button, point to JAR, and select From modules with dependencies.
To the right of the Main Class field, click the Browse button and select the main class in the dialog that opens (for example, HelloWorld (com.example.helloworld)).
IntelliJ IDEA creates the artifact configuration and shows its settings in the right-hand part of the Project Structure dialog.
Apply the changes and close the dialog.
Build the JAR artifact
From the main menu, select Build | Build Artifacts.
Point to the created
.jar(HelloWorld:jar) and select Build.If you now look at the
out/artifactsfolder, you'll find your.jarfile there.
I could able to execute the generated artifact on my PC. When the .jar is shared to my colleagues, it works fine on the PCs which have JDK installed in the same location as mine. But, on the PCs which doesn't have JDK, it gives below error messages when launched
and on clicking "OK", it says
I figured out the solution would be to install JDK on the systems which fails to execute. But, I suspect it is not a genuine solution. I would like to know the professional method of delivering the artifacts and what do I miss here?

