首页 > 解决方案 > jpackage not found - mac OS

问题描述

I'm trying to make my .jar file with the javafx stuff into an executable application, but when I try to do jpackage on the command line, I'm getting command not found. I've downloaded the latest jdk-15.0.1_osx-x64_bin.dmg from Oracle.

标签: javajavafxjlinkjpackage

解决方案


Although some Java commands are defined (eg java, javac) And are in the local /usr/bin directory, they only contain commands that were in the Java 6 release (including eg appletviewer).

Newer commands that were added in later Java releases like jmod, jlink etc aren’t available in the path. I’ve raised a radar (bug) at Apple a few years ago And the response was “so?” — don’t hold your breath.

To run these commands you will need to add the Home/bin directory of your install (under /Library/Java/JavaVirtual/Machines) to your PATH environment variable. You can also use /usr/libexec/java_home to find the path of the installed JVM automatically.


推荐阅读