Java Platform, Standard Edition

Java Usage Tracker Guide

Release 1

E50948-03

September 2017

Java Usage Tracker tracks how Oracle Java SE Advanced and Oracle Java SE Suite Java Runtime Environments (JREs) are being used in your systems. The output of Java Usage Tracker is a plain text, comma-separated record that contains the JRE version, the application being run, and other details. This record is appended to a file or sent over the network in a User Datagram Protocol (UDP) packet.

Note:

Java Usage Tracker requires a commercial license for use in production. To learn more about commercial features and how to enable them, see Oracle Java SE Advanced & Suite Products.

Java Usage Tracker System Requirements

Java Usage Tracker is available in Java for Business, Oracle Java SE Advanced, and Oracle Java SE Suite.

Supported Versions

  • Java for Business:

    • 1.4.2_35 and later

    • 5.0u33 and later

    • 6u25 and later

  • Oracle Java SE Advanced and Oracle Java SE Suite:

    • 7 and later

    • 8 and later

    • 9 and later

Note:

Java for Business versions are available to Java SE Support customers. Public versions of Java SE 1.4.2, 5.0, and 6 do not support Java Usage Tracker.

Java Usage Tracker Output

The following is an example of output from Java Usage Tracker; it is a record of one invocation of a Java application. Line breaks were added for clarity; each record appears as one line of text:

"javaws application",
"Mon Feb 01 14:52:58 PST 2016",
"MY-COMPUTER/192.0.2.0",
"https://docs.oracle.com/javase/tutorialJWS/samples/deployment/
  dynamictree_webstartJWSProject/:
  sourceURL=https://docs.oracle.com/javase/tutorialJWS/samples/
    deployment/dynamictree_webstartJWSProject/dynamictree_webstart.jnlp
  app_model=eJytU9FqE0EUvWlSk9pQsSKCIgSpKCIzD4I++BQThZS1LU1FfSrTzbTZMDszztxt
    E4WCP1HwwT/wP3z3G3z1DwS9s7tpF5Q8dR9md/aeueeec+98+wXL3sGd2KTMZ5qN
    pFVmxpw8ZF1rX5uRVFA8tSW4GkErpl8HwkuEtWgijgXXEvmb3eh5BKsj6WOXWEyM
    RlgvwkroIz5El+gjgqzLKUrtCbArvclcLD3CzQKZYaJ41zkxixKPBG5PhDuHfYBT
    qBO/MrEIBGFfi2AlFYnuKeFzwBId8jLOXIKzUDvCo4iUcVLGC2WclPG5so1hBUuE
    y5igkmWiBs4sJbi3MMEeYejglWOpR8blJ6eW/GwHRYysYWTN2f1nT2///unq0BxA
    ayz8uEeHB9CwxiFJEBmOTShjznyYXFQxNh7L75Z1Bk1sVLmvUykl5Z/yQbg2MrFn
    xolYSUalI7zioRgvOWZINEJtvh1yL1KrpC9FpVIjH820SJMYnZT7J/LAo3BI0B1n
    JjJGHphWEJbHiNbbXOWNXGXoGzvv2/Tzj7tfvouvdaiRQp98lFMbxuekEdZp3qZ2
    GKf8R42yPFgwexubFyNwMYdL/85B81g6X25DC8K7OXelLP395RjRL8J7FO7L1DCa
    0pwgLKtkTKGxyc+efKqQ718O+f/CbKKVrZaA8Hge65nUGk2Juy4es0rp5LBKCgtP
    HTxc1IPqLSmbAOvUSwdr+QCEK85e6iytBi1Cc9jd6r/YfodwvSTuBOZOcI04O4s4
    w8WqpgvKbiGsdnd2okGvuzfY3kJon6eVIv0L97SYOQ==",
"C:\Java\jre1.8.0_71",
"1.8.0_71",
"25.71-b15",
"Oracle Corporation",
"Oracle Corporation",
"Windows 7",
"x86",
"6.1",
"-Xbootclasspath/a:C:\Java\jre1.8.0_71\lib\deploy.jar;
  C:\Java\jre1.8.0_71\lib\javaws.jar;C:\Java\jre1.8.0_71\lib\plugin.jar
  -Xverify:remote
  -Djava.security.manager
  -Djava.security.policy=
    file:C:\Java\jre1.8.0_71\lib\security\javaws.policy
  -DtrustProxy=true
  -Djnlpx.home=C:\Java\jre1.8.0_71\bin
  -Djnlpx.origFilenameArg=
    C:\Users\CURRENT-USER\AppData\Local\Temp\dynamictree_webstart.jnlp
  -Djnlpx.remove=true
  -Djnlpx.splashport=60247
  -Djnlpx.jvm=C:\Java\jre1.8.0_71\bin\javaw.exe ",
".",
"user.home=C:\Users\CURRENT-USER foo.bar=null"

The following table describes each value of this comma-separated line:

Example Description

javaws application

Type of start; it has one of the following values:

  • VM start: JVM start-up (either Java application or JNI invocation)

  • plugin2: Applet

  • javaws application or javaws applet: Java Web Start

The value about the type of start is followed by one of the following values if there is a Deployment Rule Set (DRS) that specifically allows the application to run or block the app.

  • permitted

  • denied

  • denied [required version ruleVersion not available], where ruleVersion is the minimum required version of the Deployment Rule Set specification

The value about the type of start is followed by one of the following values if there is no DRS run or block rule:

  • denied [by user]

  • denied [by security settings]

  • No value (empty string): The application is allowed to run

Mon Feb 01 14:52:58 PST 2016

Date and time

MY-COMPUTER/192.0.2.0

Host name and IP address in the form <hostname>/<literalIPaddress>

https://docs.oracle.com/javase/tutorialJWS/
  samples/deployment/
  dynamictree_webstartJWSProject/:
  sourceURL=https://docs.oracle.com/
    javase/tutorialJWS/samples/deployment/
    dynamictree_webstartJWSProject/
    dynamictree_webstart.jnlp
  app_model=<Base64 encoded data>

Java command (name of main class or jar file) and list of arguments, if any (space-separated list)

Java Web Start applications have the following form:

<Document base>:
  <main class> <arguments>
  app_model=<serialized classes for use by AMC>
  app_customer=<contents of the <customer> block in a rule>

Applet invocations have the following form:

<Document base>:
  <parameters>
  app_model=<serialized classes for use by AMC>
  app_customer=<contents of the <customer> block>  

The values for app_model and app_customer are encoded in Base64.

The value of app_model contains basic information about the application, including location, codebase, and main class. Its value is the same regardless of whether the application is permitted or denied to run.

The parameter app_customer appears only if the application is governed by a specific DRS rule that DRS run rule contains a <customer> block.

C:\Java\jre1.8.0_71

Directory that contains the JRE (java.home system property value)

1.8.0_71

Java version (java.version system property value)

25.71-b15

JVM version (java.vm.version system property value)

Oracle Corporation

Java vendor (java.vendor system property value)

Oracle Corporation

JVM vendor (java.vm.vendor system property value)

Windows 7

Operating system name (os.name system property value)

x86

Operating system architecture (os.arch system property value)

6.1

Operating system version (os.version system property value)

-Xbootclasspath/a:C:\Java\jre1.8.0_71\lib\
  deploy.jar;C:\Java\jre1.8.0_71\lib\javaws.jar;
  C:\Java\jre1.8.0_71\lib\plugin.jar
  -Xverify:remote
  -Djava.security.manager
  -Djava.security.policy=file:C:\Java\jre1.8.0_71\
    lib\security\javaws.policy
  -DtrustProxy=true
  -Djnlpx.home=C:\Java\jre1.8.0_71\bin
  -Djnlpx.origFilenameArg=C:\Users\CURRENT-USER\
    AppData\Local\Temp\dynamictree_webstart.jnlp
  -Djnlpx.remove=true
  -Djnlpx.splashport=60247
  -Djnlpx.jvm=C:\Java\jre1.8.0_71\bin\javaw.exe

JVM arguments (space-separated list); empty if there are no JVM arguments; n/a if this information is not available (for example, in Java SE 1.4.2, this information is not available)

.

Class path (java.class.path system property value)

user.home=C:\Users\CURRENT-USER foo.bar=null

Name=value pairs of any additional system properties specified in the Java Usage Tracker properties file. Multiple pairs are space-separated; empty if no additional property names are specified (default).

Items that Contain Spaces in Java Usage Tracker Output

In the fields that are space-separated lists, a different quote character (by default, the single quotation mark, ') is used to quote an item that contains a space. Any existing quote characters are printed twice.

For example, consider the following command:

/jdk1.8.0_20/bin/java
  -Dfoo1="a b"
  -Dfoo=\"
  -jar c:\\Program\ Files\\Java/jdk1.6.0_25/demo/jfc/Java2D/Java2Demo.jar

Java Usage Tracker prints these system properties as follows (line breaks were added for clarity):

"'-Dfoo1=a b' -Dfoo="" ",
"-jar c:\Program Files\Java/jdk1.6.0_25/demo/jfc/Java2D/Java2Demo.jar",
""

For versions Oracle Java SE Advanced and Oracle Java SE Suite prior to 8u20, Java Usage Tracker does not surround fields with quotation marks.

Enabling and Configuring Java Usage Tracker

Java Usage Tracker is disabled by default. Enable and configure it by creating a properties file named usagetracker.properties. See Example Java Usage Tracker properties File.

For Oracle Java SE Advanced and Oracle Java SE Suite versions 8u152 and later and 9 and later, if you want Java Usage Tracker to track all JREs on your system, then put the usagetracker.properties file in the central file system location, which differs depending on your operating system:

  • Windows: %ProgramData%\Oracle\Java\

  • Linux and Solaris: /etc/oracle/java/

  • macOS: /Library/Application Support/Oracle/Java/

If you want Java Usage Tracker to track a specific JRE, then ensure that the usagetracker.properties file doesn’t exist in the central file system location, and put the usagetracker.properties file in the directory <JRE directory>/conf/management/ (<JRE directory>/lib/management/ for JRE releases prior to 9). Note that the path name is different, depending on whether you are configuring Java Usage Tracker for a JDK or for a JRE.

For additional flexibility, if you want to use a different properties file, then you can specify it with the system property -Dcom.oracle.usagetracker.config.file on the command line. In the following example, Java Usage Tracker uses the properties file /path/usagetracker.properties:

java -Dcom.oracle.usagetracker.config.file=/path/usagetracker.properties MyApplication

The JVM searches the following locations, in order, for a usagetracker.properties file. It uses the first one it finds to enable and configure Java Usage Tracker.

  1. Path specified by the system property -Dcom.oracle.usagetracker.config.file

  2. Central file system location (for Oracle Java SE Advanced and Oracle Java SE Suite versions 8u152 and later and 9 and later)

  3. <JRE directory>/conf/management/ (<JRE directory>/lib/management/ for JRE releases prior to 9)

Note:

To enable Java Usage Tracker, the usagetracker.properties file that you create must have a valid value for at least one of the following properties:
  • com.oracle.usagetracker.logToFile

  • com.oracle.usagetracker.logToUDP

Java Usage Tracker Properties

This section describes the properties you can specify in the Java Usage Tracker properties file.

These properties are set only in the Java Usage Tracker properties file; they are not set at the command line. This is intended so that Java Usage Tracker has no impact on or interaction with the JRE user or existing applications.

Note:

Note:

The backslash (\) is an escape character in a properties file. Consequently, when specifying file paths that include directories or drive letters, use a forward slash (/) or an escaped backslash (\\) as a directory separator.

Property Description

com.oracle.usagetracker.additionalProperties

Use this property to record values of additional Java properties and their values.

The value of this property is a comma-separated list of properties and their values. For example (ignore line break):

com.oracle.usagetracker.additionalProperties =
com.company.interestingProperty,com.anotherInterestingProperty

com.oracle.usagetracker.innerQuote

The character or string used to quote items that contain a space in the JVM argument field list and the additional properties field. The default value is the single quotation mark (').

This property is available in Oracle Java SE Advanced and Oracle Java SE Suite versions 8u20 and later.

com.oracle.usagetracker.logFileMaxSize

The log file size limit, in bytes. If the file size equals or exceeds the given value when logging is attempted, that attempt will be canceled.

If this property is not set, then there is no log file limit.

com.oracle.usagetracker.logToFile

If this property is specified, the fully qualified path name of the file to which Usage Tracker writes records.

You can specify ${user.home} in the path name. The property will expand to the user's home directory. For example (ignore line break):

com.oracle.usagetracker.logToFile = ${user.home}/.java_usagetracker

com.oracle.usagetracker.logToUDP

If this property is specified, Java Usage Tracker logs to the specified remote host in a UDP packet. For example (ignore line break):

com.oracle.usagetracker.logToUDP =
loggingmachine.domainname:32139

Specifying an IP address may be faster in some cases; although, this resolution does not delay the startup of the JVM or the application.

See Sample: Receiver for UDP Packets for an example application that can receive UDP packets.

com.oracle.usagetracker.maxFieldSize

Any single field limit, in bytes. The default is no limit. Java Usage Tracker truncates a field to this limit, without breaking the record format, if the com.oracle.usagetracker.sendTruncatedRecords property is true.

This property is available in Oracle Java SE Advanced and Oracle Java SE Suite versions 8u152 and later and 9 and later.

com.oracle.usagetracker.maxSize

Overall record limit, in bytes. The default is no limit. Java Usage Tracker truncates records to this limit if the com.oracle.usagetracker.sendTruncatedRecords property is true.

This property is available in Oracle Java SE Advanced and Oracle Java SE Suite versions 8u152 and later and 9 and later.

com.oracle.usagetracker.quote

The character or string used to quote fields. The default value is the double quotation mark (").

This property is available in Oracle Java SE Advanced and Oracle Java SE Suite versions 8u20 and later.

com.oracle.usagetracker.sendTruncatedRecords

Truncates records and individual fields if they exceed the sizes specified by the com.oracle.usagetracker.maxSize and com.oracle.usagetracker.maxFieldSize properties, respectively. The default value is true.

This property is available in Oracle Java SE Advanced and Oracle Java SE Suite versions 8u152 and later and 9 and later.

com.oracle.usagetracker.separator

The character or string that separates entries in the log file. The default is the comma (,).

com.oracle.usagetracker.track.last.usage

Enables or disables last usage time tracking. The default value is true. Last usage time tracking records, in a file, the last time the JRE was used for an applet or Java Web Start application, invoked from the command line, or through any other method. This feature creates a file in one of the following directories, depending on your operating system:
  • Windows: %ProgramData%\Oracle\Java\.oracle_jre-usage\

  • All other operating systems: ${user.home}/.oracle_jre_usage/

Note:

Java Usage Tracker, which is a commercial feature, and last usage time tracking, which is not a commercial feature, are enabled separately; disabling one does not disable the other.

com.oracle.usagetracker.verbose

If this property is set to true, error information may be reported to the standard error stream; this is only recommended for diagnostic purposes.

Example Java Usage Tracker properties File

To create a Java Usage Tracker properties file, you can use the following example as a template. Lines that begin with the pound sign (#) are comments.

# UsageTracker template properties file.
# Copy to <JRE directory>/conf/management/usagetracker.properties
# (or <JRE directory>/lib/management/usagetracker.properties for
# JRE releases prior to 9) and edit, uncommenting required settings, to enable.
 
# Settings for logging to a file:
# Use forward slashes (/) because backslash is an escape character in a
# properties file.
# com.oracle.usagetracker.logToFile = ${user.home}/.java_usagetracker

# Settings for logging to a UDP socket:
# com.oracle.usagetracker.logToUDP = hostname.domain:32139
  
# (Optional) Specify a file size limit in bytes:
# com.oracle.usagetracker.logFileMaxSize = 10000000
 
# If the record should include additional Java properties,
# this can be a comma-separated list:
# com.oracle.usagetracker.additionalProperties = 
 
# Additional options:
# com.oracle.usagetracker.verbose = true
# com.oracle.usagetracker.track.last.usage = false
com.oracle.usagetracker.separator = ,
com.oracle.usagetracker.quote = "
com.oracle.usagetracker.innerquote = '

Java Usage Tracker Sample: Receiver for UDP Packets

The following sample, UsageServerTracker.java, is a simple application that listens for Java Usage Tracker data:

/*
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * -Redistribution of source code must retain the above copyright notice, this
 *  list of conditions and the following disclaimer.
 *
 * -Redistribution in binary form must reproduce the above copyright notice,
 *  this list of conditions and the following disclaimer in the documentation
 *  and/or other materials provided with the distribution.
 *
 * Neither the name of Oracle or the names of contributors may
 * be used to endorse or promote products derived from this software without
 * specific prior written permission.
 *
 * This software is provided "AS IS," without a warranty of any kind. ALL
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
 * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
 * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
 * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
 * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
 * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
 * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 *
 * You acknowledge that this software is not designed, licensed or intended
 * for use in the design, construction, operation or maintenance of any
 * nuclear facility.
 */
 
import java.net.InetAddress;
import java.net.DatagramSocket;
import java.net.DatagramPacket;
import java.io.IOException;
import java.net.SocketException;
 
import java.io.File;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
 
/**
  * A daemon that listens for and logs UsageTracker information.
  */
public class UsageTrackerServer {
 
    static boolean verbose = false;
    boolean initialized = false;
    String logFileName = null;
    File logFile;
    OutputStreamWriter writer;
    int port = 32139;
    InetAddress address = null;
    DatagramSocket socket;
    private static final int BUFFERSIZE = 65536;
    long received = 0;
    boolean running = true;
 
    /**
      * Main entry point for starting this daemon.
      */
    public static void main(String [] args) {
        try {
            UsageTrackerServer uts = new UsageTrackerServer(args);
            uts.run();
        } catch (Exception e) {
            System.out.println("UsageTrackerServer: " + e.getMessage());
            if (verbose) {
                e.printStackTrace();
            }
            System.exit(1);
        }
    }
 
    public static void usage() {
        System.out.println("UsageTrackerServer [-v] [-o filename] [host]:port\n" +
            "e.g. UsageTrackerServer -o usagetracker.out :32139\n");
    }
 
    /**
      * Initialize a UsageTrackerServer given some arguments.
      */
    UsageTrackerServer(String [] args) throws Exception {
 
        boolean usage = false;
        for (int i=0; i<args.length; i++) {
 
            if (args[i].equals("-?") || args[i].equals("--h")) {
                usage = true;
                break;
            } else if (args[i].equals("-v")) {
               verbose = true;
            } else if (args[i].equals("-o")) {
                logFileName = args[i+1];
                i++;
            } else if (args[i].contains(":")) {
                // parse [address]:port
                int colon = args[i].indexOf(':');
                if (colon > 0) {
                    try {
                        address = InetAddress.getByName(
                            args[i].substring(0, colon));
                    } catch (Exception ae) {
                        System.out.println("UsageTrackerServer: " +
                            "problem setting listen address: " + ae);
                        usage = true;
                    }
                }
                try {
                    port = Integer.parseInt(args[i].substring(colon+1));
                } catch (NumberFormatException nfe) {
                    System.out.println("UsageTrackerServer: cannot set port: " +
                        args[i].substring(colon+1));
                    usage = true;
                }
            } else {
                usage = true;
            }
        }
        // Argument failure or request for usage gets the usage message only:
        if (usage) {
            usage();
            return;
        }
        // Otherwise, continue to proper initialization:
        socket = null;
        try {
        if (address != null) {
            socket = new DatagramSocket(port, address);
        } else {
            socket = new DatagramSocket(port);
        }
        } catch (SocketException se) {
            throw new Exception("problem creating socket: " + se);
        }
        if (logFileName != null) {
            try {
                File logFile = new File(logFileName);
                if (verbose) {
                    System.out.println("Using logfile: " + logFileName);
                    if (logFile.exists()) {
                        System.out.println("File exists, will append.");
                    }
                }
                FileOutputStream fos = new FileOutputStream(logFile, true);
                writer = new OutputStreamWriter(fos, "UTF-8");
            } catch (IOException ioe) {
                throw new Exception("problem using file " + logFileName + ": " +
                    ioe);
            }
        }
        initialized = true;
    }
 
   public void run() throws Exception {
        if (!initialized) {
            return;
        }
        Runnable r = null;
        if (writer == null) {
            r = new UsageTrackerServerRunnable(socket);
        } else {
            r = new UsageTrackerServerRunnable(socket, writer);
        }
        Thread t = new Thread(r, "UsageTrackerServerRunnable");
        t.start();
        t.join();
    }
 
    /**
      * Runnable that listens and logs.
      */
    private class UsageTrackerServerRunnable implements Runnable {
        DatagramSocket listenSocket;
        OutputStreamWriter writer = null;
 
        UsageTrackerServerRunnable(DatagramSocket socket) {
            listenSocket = socket;
        }
        UsageTrackerServerRunnable(DatagramSocket socket,
            OutputStreamWriter writer) {
            this(socket);
            this.writer = writer;
        }
 
        public void run() {
            byte [] buf = new byte[BUFFERSIZE];
            DatagramPacket packet = new DatagramPacket(buf, buf.length);
 
            // Ready to receive data
            if (verbose) {
                String addr = listenSocket.getLocalAddress().getHostAddress();
                if (addr.equals("0.0.0.0")) {
                    addr = "localhost";
                }
                System.out.println("UsageTrackerServer: ready to receive on " +
                    addr + ":" + listenSocket.getLocalPort());
            }
            while (running) {
                try {
                    listenSocket.receive(packet);
                    String dataReceived = new String(packet.getData(), 0,
                        packet.getLength());
 
                    // The format of a UsageTracker record contains a newline at
                    // the end; if that is missing, we have a truncated/corrupt
                    // packet.
                    if (!dataReceived.endsWith("\n")) {
                        System.out.println("Incomplete message received: " +
                          "size = " + packet.getLength() + ", data =  " +
                          dataReceived);
                        dataReceived = dataReceived + "\n";
                    }
                    received++;
                    if (verbose) {
                        System.out.println("Received message size: " +
                            dataReceived.length());
                    }
                    if (writer != null) {
                        writer.write(dataReceived, 0, dataReceived.length());
                        writer.flush();
                    } else {
                        System.out.print(dataReceived);
                    }
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                }
            }
        }
    }
}

The following is an example of running this sample:

java UsageTrackerServer -v -o usagetracker.out :32139
  • The -v option is verbose; if you specify this option, the sample displays additional information.

  • The -o option enables you to specify the name of a log file; if you do not specify this option, the sample prints messages to standard output.

  • In this example, the UDP receiver listens on the localhost address on port 32139. When a JRE (with an enabled and configured Java Usage Tracker) sends data, the receiver will send the data to the file usagetracker.out. The port number is arbitrary but must be available and must match the one configured in the JRE. If multiple interfaces exist, it may be necessary to specify the port using the form hostname:port or ipaddress:port.

Java Usage Tracker Errors and Exceptions

If Java Usage Tracker encounters an error or exception during the logging of a record, it does not interrupt the application currently running.

Java Usage Tracker does not report errors unless the property oracle.usagetracker.verbose is specified in the properties file.

Managing Disk Space Used by Java Usage Tracker Log File

Although the size of the Java Usage Tracker log file is small, consider periodically truncate, compress, archive, or delete the log file. When Java Usage Tracker incrementally adds records to the log file, it does not check for available disk space or perform administrative tasks such as truncating, deleting, or compressing the log file in order to be minimally intrusive.

In addition, you can specify the maximum size of the log file, in bytes, with the oracle.usagetracker.logFileMaxSize property in the properties file.

Java Usage Tracker Limitations

Java Usage Tracker cannot log Java command line options that are processed by the Java launcher before the JVM is started. For example, Java Usage Tracker does not record the command line options -client and -server that select the Java HotSpot client and server VM, respectively. In addition, Java Usage Tracker may not log an application if it terminates immediately because it will not stop a process from exiting.

Java Usage Tracker Frequently Asked Questions

Here are answers to some frequently asked questions:

Does Java Usage Tracker affect the private JRE within a JDK, or does it only affect the standalone JRE?

If you have a JDK installed in a computer, there is a JRE in the jre subdirectory; this is the private JRE referred to in the question. Yes, Java Usage Tracker logs the usage of both the private JRE and the standalone JRE, but note that they are configured separately through their own individual conf/management/usagetracker.properties files.

Can Java Usage Tracker log the usage of JDK tools?

If Java Usage Tracker is enabled, it logs the usage of tools that come with the JDK such as jmap and jstack.

Does Java Usage Tracker log the usage of JVMs created by native Java applications?

Yes. When a native application creates a JVM with the Java Native Interface (JNI), Java Usage Tracker logs this invocation with a blank Java command.

Will an invocation similar to java -jar file.jar be tracked by Java Usage Tracker?

Yes.

Does Oracle capture any of the data logged by Java Usage Tracker?

No. As the administrator of the JRE installation, usage data obtained from Java Usage Tracker is stored in the file of your choice or sent to the UDP host and port that you specify. There is no facility for this data to leave your own network. (Theoretically, if your firewall permits it, the port your UDP host listens on could be configured as remote, but this is not expected or recommended usage.)

What does the log record look like for native applications, applets, and denied applications?

The following is an example of a log record for a native application (line breaks were added for clarity):

"VM start",
"Mon Feb 01 14:29:35 PST 2016",
"MY-COMPUTER/192.0.2.0",
"com.sun.deploy.panel.ControlPanel",
"C:\Java\jre1.8.0_71",
"1.8.0_71",
"25.71-b15",
"Oracle Corporation",
"Oracle Corporation",
"Windows 7",
"amd64",
"6.1",
"-Xbootclasspath/a:C:\Java\jre1.8.0_71\bin\..\lib\deploy.jar
  -Djava.locale.providers=HOST,JRE,SPI
  -Duser.home=C:\Users\CURRENT-USER",
".",
""

The following is an example of a log record for an applet:

"plugin2",
"Mon Feb 01 14:51:02 PST 2016",
"MY-COMPUTER/192.0.2.0",
"http://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html:
  jnlp_href=examples/dist/applet_ComponentArch_DynamicTreeDemo/dynamictree_applet.jnlp
  codebase_lookup=false
  code=appletComponentArch.DynamicTreeApplet.class
  codebase=http://docs.oracle.com/javase/tutorial/deployment/applet/
  width=450
  archive=examples/dist/applet_ComponentArch_DynamicTreeDemo/DynamicTreeDemo.jar
  height=450
  app_model=eJy1U71uE0EQHv8kdogVhFEaEJKFEoEodjsoqA47RdABUWwQXbScN/FGd7vL7pw5
    U0TiJZAoeAPeg55noOUNkGD2fP4BJHdccbc/38w33zdzX37AlndwOzEZ87lmY2lT
    M2NOnrPI2mdmLFOYP7U6XIuhndDRG+Elwl58KaaCa4n85Wn8OIbdsfSJUxaV0Qjd
    +XUq9AUfolP6giBdWaDUngCn0pvcJdIj7M+ROaqUR86JWaw8ErhzKdwS9hauoEH8
    qUlEIAj7Wgw7mVC6nwpfAuoU5GWSO4WzUDvCg5iUcVLG58o4KeMLZQfDNSwRbqHC
    VFaJmjizlODuxgQjwlDg9lTqsXFlZGHJz05QxMgaRtZ8PHz08NbP764BrWNoT4Sf
    9Cn4GJrWOCQJIseJCWUsmM/VqoqJ8Vit29YZNIlJq32DSqkof1UPwvWxSTwzTiSp
    ZFQ6wiseivGSY45EI9JKSSY1cmFtSg2Uhcho4fmYrK8Oz/oms0YTKnLJ5Gww0yJT
    ychJOZCZ4YF5B6lARGtL0TdL0aGNbNnG4sO3O5++is8NqJFgr97LwoZpetcM76Ls
    WidMV3lQoyz3NoziwdPVRKzGsv7vWLSm0vlqGzoSvq2FSVXl6v/48tee0RCXhOG1
    S0YVFuFwnumPRGwtMCqvrxzc32TG+vRWbkCXTHWwV3Yi/HrsSOfZ+iWxt4bR88GT
    F68RblScvUDaC+USZ28TZxj49XRB1T7CdnRyEh+NEDrLjFJkvwEAyW8t",
"C:\Java\jre1.8.0_71",
"1.8.0_71",
"25.71-b15",
"Oracle Corporation",
"Oracle Corporation",
"Windows 7",
"x86",
"6.1",
"-Xbootclasspath/a:C:\Java\jre1.8.0_71\lib\deploy.jar;
  C:\Java\jre1.8.0_71\lib\javaws.jar;C:\Java\jre1.8.0_71\lib\plugin.jar
  -Djava.security.manager
  -D__jvm_launched=29258397636
  -D__applet_launched=29258393819 ",
"C:\Java\jre1.8.0_71\classes",
""

The following is an example of a log record of a Java Web Start application that was denied by security settings:

"javaws application denied [by security settings]",
"Tue Nov 03 19:43:57 MSK 2015",
"example.com/192.0.2.0",
"https://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html:
  sourceURL=https://docs.oracle.com/javase/tutorialJWS/samples/deployment/
    dynamictree_webstartJWSProject/dynamictree_webstart.jnlp
  app_model=eJytU9FqE0EUvWlSk9pQsSKCIgSpKCIzD4I++BQThZS1LU1FfSrTzbTZMDszztxt
    E4WCP1HwwT/wP3z3G3z1DwS9s7tpF5Q8dR9md/aeueeec+98+wXL3sGd2KTMZ5qN
    pFVmxpw8ZF1rX5uRVFA8tSW4GkErpl8HwkuEtWgijgXXEvmb3eh5BKsj6WOXWEyM
    RlgvwkroIz5El+gjgqzLKUrtCbArvclcLD3CzQKZYaJ41zkxixKPBG5PhDuHfYBT
    qBO/MrEIBGFfi2AlFYnuKeFzwBId8jLOXIKzUDvCo4iUcVLGC2WclPG5so1hBUuE
    y5igkmWiBs4sJbi3MMEeYejglWOpR8blJ6eW/GwHRYysYWTN2f1nT2///unq0BxA
    ayz8uEeHB9CwxiFJEBmOTShjznyYXFQxNh7L75Z1Bk1sVLmvUykl5Z/yQbg2MrFn
    xolYSUalI7zioRgvOWZINEJtvh1yL1KrpC9FpVIjH820SJMYnZT7J/LAo3BI0B1n
    JjJGHphWEJbHiNbbXOWNXGXoGzvv2/Tzj7tfvouvdaiRQp98lFMbxuekEdZp3qZ2
    GKf8R42yPFgwexubFyNwMYdL/85B81g6X25DC8K7OXelLP395RjRL8J7FO7L1DCa
    0pwgLKtkTKGxyc+efKqQ718O+f/CbKKVrZaA8Hge65nUGk2Juy4es0rp5LBKCgtP
    HTxc1IPqLSmbAOvUSwdr+QCEK85e6iytBi1Cc9jd6r/YfodwvSTuBOZOcI04O4s4
    w8WqpgvKbiGsdnd2okGvuzfY3kJon6eVIv0L97SYOQ==",
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home",
"1.8.0_65",
"25.65-b01",
"Oracle Corporation",
"Oracle Corporation",
"Mac OS X",
"x86_64",
"10.10.5",
"'-Djava.security.policy=file:/Library/Internet Plug-Ins/
  JavaAppletPlugin.plugin/Contents/Home/lib/security/javaws.policy'
  -DtrustProxy=true
  -Xverify:remote '-Djnlpx.home=/Library/Internet Plug-Ins/
    JavaAppletPlugin.plugin/Contents/Home/bin'
  -Djava.security.manager
  -Djnlpx.origFilenameArg=/Users/CURRENT-USER/Library/Caches/Java/
    dynamictree_webstart.jnlp
  -Djnlpx.remove=false
  -Dsun.awt.warmup=true '-Xbootclasspath/a:/Library/Internet Plug-Ins/
    JavaAppletPlugin.plugin/Contents/Home/lib/javaws.jar:/Library/
    Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/
    deploy.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/
    Contents/Home/lib/plugin.jar' '-Dmacosx.jnlpx.dock.name=Java Web
    Start' '-Dmacosx.jnlpx.dock.icon=/Library/Internet Plug-Ins/
    JavaAppletPlugin.plugin/Contents/Home/lib/deploy/
    webStartAppIcon.icns' '-Djnlpx.jvm=""/Library/Internet Plug-Ins/
      JavaAppletPlugin.plugin/Contents/Home/bin/java""' ",
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/
  lib/deploy.jar",
""

How can I remove the quoting behavior of Oracle Java SE Advanced and Oracle Java SE Suite versions 8u20 and later for records with the previous formatting?

In the Java Usage Tracker properties file, set blank quote characters with the following two lines:

com.oracle.usagetracker.quote=
com.oracle.usagetracker.innerQuote=

Documentation Accessibility

For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.


Java Platform, Standard Edition Java Usage Tracker Guide, Release 1

E50948-03

Copyright © 2014, 2017, Oracle and/or its affiliates. All rights reserved.

Describes how to configure, enable, and troubleshoot Java Usage Tracker; interpret its output; and create applications that listen for its data.

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.