且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“java"、“javaw"和“javaws"有什么区别?

更新时间:2023-09-17 08:57:28

请参阅 Java 工具文档以了解:

  1. java 工具启动 Java 应用程序.它通过启动 Java 运行时环境、加载指定的类并调用该类的 main 方法来实现这一点.
  2. javaw 命令与 java 相同,除了 javaw 没有关联的控制台窗口.当您希望出现命令提示符窗口时,请使用 javaw.

javaws 命令启动 Java Web Start,它是 Java 网络启动协议 (JNLP) 的参考实现.Java Web Start 启动托管在网络上的 Java 应用程序/小程序.

如果指定了 JNLP 文件,javaws 将启动 JNLP 文件中指定的 Java 应用程序/小程序.

javaws 启动器有一组当前版本支持的选项.但是,这些选项可能会在未来版本中删除.

另请参阅 JDK 9 发行说明已弃用的 API、功能和选项:

Java 部署技术已弃用,将在未来版本中删除
Java Applet 和 WebStart 功能,包括 Applet API、Java 插件、Java Applet 查看器、JNLP 和 Java Web Start,包括 javaws 工具,都是 在 JDK 9 中已弃用,并将在未来版本中删除.

What is the difference between java, javaw, and javaws?

I have found that on Windows most usage of Java is done using javaw.

See Java tools documentation for:

  1. The java tool launches a Java application. It does this by starting a Java runtime environment, loading a specified class, and invoking that class's main method.
  2. The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear.

The javaws command launches Java Web Start, which is the reference implementation of the Java Network Launching Protocol (JNLP). Java Web Start launches Java applications/applets hosted on a network.

If a JNLP file is specified, javaws will launch the Java application/applet specified in the JNLP file.

The javaws launcher has a set of options that are supported in the current release. However, the options may be removed in a future release.

See also JDK 9 Release Notes Deprecated APIs, Features, and Options:

Java Deployment Technologies are deprecated and will be removed in a future release
Java Applet and WebStart functionality, including the Applet API, the Java plug-in, the Java Applet Viewer, JNLP and Java Web Start, including the javaws tool, are all deprecated in JDK 9 and will be removed in a future release.