javaws Command in Linux



The javaws command in Linux is a utility that allows users to launch Java Web Start applications. Java Web Start enables users to start application software for the Java Platform directly from the Internet using a web browser.

The javaws command, short for Java Web Start, is a utility that allows users to launch Java applications and applets hosted on a network. This command is part of the Java Runtime Environment (JRE) and provides a platform-independent deployment technology for Java applications.

Table of Contents

Here is a comprehensive guide to the options available with the javaws command −

Understanding the javaws Command

Understanding these options can greatly enhance the user's ability to manage and launch Java Web Start applications effectively. It's important to note that some options are advanced and should be used with caution, as they can alter the security and behavior of the applications being launched.

How to Use javaws Command in Linux

Here's a comprehensive guide to using the javaws command in Linux with examples and explanations.

Basic Usage

The most basic use of javaws is to launch a Java application or applet specified in a Java Network Launching Protocol (JNLP) file.

Syntax of javaws Command

The syntax is as follows −

javaws [options] jnlp-file

Where jnlp-file is the path or URL to the JNLP file.

Options of javaws Command

Options Descriptions
-about Displays a sample application.
-help Prints out information about supported commands and basic usage.
-license Displays the GPL license and exits.
-viewer Shows the trusted certificate viewer.
-Xcacheids Lists available IDs in the cache, which can be used to delete individual applications.
-Xclearcache Cleans the JNLP application cache. If an argument is passed, only the specified application is deleted.
-headless Disables download window and other UIs.
-allowredirect Allows HTTP redirects.
-arg Adds an application argument before launching.
-browser Launches an embedded browser (use only when necessary).
-html Specifies the location of the HTML file to launch.
-jnlp Specifies the location of the JNLP file to launch.
-nosecurity Disables the secure runtime environment.
-noupdate Disables checking for updates.
-param Adds an applet parameter before launching.
-property Sets a system property before launching.
-startuptracker Enables startup time tracker.
-strict Enables strict checking of the JNLP file format.
-update Checks for updates at specified intervals.
-verbose Enables verbose output.
-version Prints the IcedTea-Web version and exits.
-Xignoreheaders Skips jar header verification.
-xml Uses a strict XML parser to parse the JNLP file.

Each option serves a specific purpose and can be combined to tailor the behavior of the javaws command as needed for various scenarios. For instance, -Xclearcache is particularly useful for troubleshooting or maintenance purposes, while -verbose can aid in debugging issues by providing additional output.

Examples of javaaws Command

In this section, we have a set of examples that demonstrate the use of javaaws command in Linux −

  • Starting an Application
  • Viewing Cache
  • Clearing Cache
  • Uninstalling Applications
  • Importing Applications to Cache
  • Setting Properties
  • Advanced JVM Options
  • Running in Offline Mode
  • Waiting for Application to Exit

Starting an Application

To start an application with javaws, simply pass the JNLP file as an argument −

javaws
Starting Application Uing javaws Command1

Or, if the JNLP file is hosted online −

javaws http://www.example.com/application.jnlp
Starting Application Uing javaws Command2

Viewing Cache

To view the cache viewer in the Java Control Panel, use the -viewer option −

javaws -viewer
Viewing Cache Uing javaws Command

Clearing Cache

To clear the Java Web Start cache, removing all non-installed applications, use the -clearcache option −

javaws -clearcache
Clearing Cache Uing javaws Command

Uninstalling Applications

To uninstall all applications from the cache −

javaws -uninstall
Uninstalling Applications Uing javaws Command1

To remove a specific application, specify the JNLP file −

javaws -uninstall /home/application.jnlp
Uninstalling Applications Uing javaws Command2

Importing Applications to Cache

To import an application to the cache without user interaction, use the -silent and -import options −

javaws -silent -import /application.jnlp
Importing Applications to Cache Uing javaws

Setting Properties

To set a specific deployment property, use the -userConfig option −

javaws -userConfig property-name property-value
Setting Properties Uing javaws Command

To clear a deployment property −

javaws -userConfig property-name

Advanced JVM Options

Pass options to the Java Virtual Machine (JVM) using the -J option −

javaws -J-Xms256m -J-Xmx512m application.jnlp
Advanced JVM Options Uing javaws

This sets the initial heap size to 256 MB and the maximum heap size to 512 MB.

Running in Offline Mode

To run an application in offline mode, use the -offline option −

javaws -offline application.jnlp
Running in Offline Mode in javaws

Waiting for Application to Exit

To start the Java process and wait for its exit, use the -wait option −

javaws -wait application.jnlp
Waiting for Application to Exit Uing javaws

For more detailed information and examples of how to use these options, users can refer to the javaws manual page or the official documentation provided by their Linux distribution or the developers of the Java application they are attempting to run.

Conclusion

The javaws command is a versatile tool for managing Java applications in Linux. It provides options for starting applications, managing the cache, setting properties, and more. By understanding and utilizing these options, users can effectively deploy and control Java applications in their environment.

For more detailed information about the javaws command and its options, you can refer to the official Oracle documentation, Arch Linux manual pages, or other online tutorials.

Remember that the availability of options may vary based on the version of Java installed, and some options may be deprecated in future releases. Always consult the latest documentation for the most accurate information.

Advertisements