javajarmacos-sierrajava-8

How to make a .jar open using a specific jdk?


I've ran into an issue. I'm running on macOS Sierra (10.12.1). This .jar file I downloaded requires a JDK. So, I installed JDK8 (jdk180121). I was able to extract JDK8 .pkg without typing in my password (authenticate). I then tried to place the new folder into the proper place. However, it asks me to authenticate the JDK (aka asks for the password). I do not want to give my password, so, therefore, I can't place it in the proper location. However, I still need to open the .jar file I mentioned earlier. How can I point the .jar file to where the JDK8 is located?

OSX: 10.12.2 JDK: jdk180121 .jar: craftbukkit-1.11.2(.jar)


Solution

  • To launch with a specific JRE (You wouldn't need the JDK to just run an application) you can do it through the command line.

    Open a terminal and navigate to the directory with the Java binary and launch this way:

    java -jar path/to/jar/program.jar