JSE JAVA DISCOVERY - CUT-DOWN EDITION (WINDOWS)
================================================
From Lime Software Ltd  |  https://www.jse-license.com  |  hello@jse-license.com
Version 1.0 (2026-11-20)


READ THIS FIRST - WHAT THIS IS, AND WHAT IT IS NOT
--------------------------------------------------
This is a free, CUT-DOWN discovery script. It gives you a quick, indicative list
of the Java installations on ONE Windows computer.

  * It is NOT the JSE-License collection tooling used in a Java Licensing Risk Review.
  * It is NOT an Oracle-verified solution. It is not part of the 3rd Party Tool Vendor
    (3PTV) tooling, and it does not produce a 3PTV statement.
  * Its output is NOT a licence position, a compliance report, or audit evidence.
  * Do NOT send its output to Oracle, or rely on it in an audit or negotiation.
  * It is provided free, as-is, without warranty or support. Test it on a non-production
    machine first, under your own change control.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Lime Software
Ltd is not affiliated with or endorsed by Oracle through this script.


WHAT IT DOES
------------
  * Looks in the usual Java locations on this computer: Program Files, Program Files (x86),
    ProgramData\Oracle\Java, C:\Java, C:\jdk*, C:\jre*, and the Windows system folders (where
    Oracle's installer leaves a java.exe launcher stub).
  * Optionally (switches) looks under user profiles and any extra folders you name.
  * For each java.exe found, reads the "release" file next to it and the file's properties
    to report vendor and version, and whether it is a JDK or a JRE.
  * Notes which installs have a Java process running right now.
  * Compares each install's version with a built-in table of the latest Oracle update for its
    release line and flags installs that are behind or no longer updated (see PATCH-LEVEL CHECK).
  * Writes two files into the output folder: a CSV of installations and a short summary.

WHAT IT NEVER DOES
------------------
  * Makes no network connections. Nothing is uploaded or sent anywhere.
  * Installs nothing, changes no settings, and writes only to the output folder.
  * Does not read process command lines (they can contain passwords), user names, or file
    contents. Only the program's file path is read.
  * Does not collect CPU, core, socket or virtualisation details.
  * Does not run any Java program unless you add -VerifyWithJava.
  * Does not scan other computers. Run it once per machine.

You can (and should) read the script before running it. It is a plain text file with
comments: Get-JavaDiscovery.ps1. Checksums for the download are on the download page.


HOW TO RUN IT
-------------
Requirements: Windows PowerShell 5.1 (built into Windows 10/11 and Server 2016+) or
PowerShell 7+. Administrator rights are NOT required, but without them some folders and
other users' processes cannot be read. For the most complete result, run from an elevated
(Administrator) PowerShell window if your change process allows.

  1. Unzip the download to a folder, e.g. C:\Temp\JSE-Discovery
     (If Windows marks the files as downloaded from the internet, right-click the zip
      before unzipping > Properties > Unblock, or run: Unblock-File .\Get-JavaDiscovery.ps1)

  2. Open PowerShell in that folder (File Explorer: type "powershell" in the address bar).

  3. Run:

       powershell -ExecutionPolicy Bypass -File .\Get-JavaDiscovery.ps1

     "-ExecutionPolicy Bypass" applies to this one run only and does not change your
     machine's policy. If your organisation requires signed scripts, ask your security team
     to review the script and run it under your own policy instead.

  4. Wait for it to finish (usually 1 to 5 minutes; longer on machines with large disks
     of Program Files). Results appear in .\JSE-Discovery-Output\

Useful options:

  -OutputPath C:\Temp\java           Where to write the results
  -IncludeUserProfiles               Also check common per-user Java locations in C:\Users
  -ExtraPath 'D:\Apps','E:\Tools'    Extra folders to search
  -VerifyWithJava                    Also RUN each java.exe found with "-version" to read the
                                     vendor/version it reports (only if you are comfortable
                                     launching those programs)
  -Quiet                             No on-screen progress

Example:

  powershell -ExecutionPolicy Bypass -File .\Get-JavaDiscovery.ps1 -IncludeUserProfiles -ExtraPath 'D:\Apps'

Running it on many machines: you can deploy it yourself with SCCM, Intune or a login script
and give each machine its own copy of the results (for example by writing to a network share
using -OutputPath \\server\share\java). The file names include the computer name and time, so
results do not overwrite each other. Please test on a small group first.


PATCH-LEVEL CHECK
-----------------
Each install gets a PatchStatus, compared against the latest Oracle Java SE updates known to
this version of the script (Oracle's 17 November 2026 security update; table dated 2026-11-20):

    8u513   11.0.33.1   17.0.21.1   21.0.13.1   25.0.5.1   27.0.1.1

  Up to date          At or above the latest known update for its release line.
  Behind latest       A newer Oracle update exists. Apply your vendor's latest update.
  No longer updated   The release line (for example 7, 9, 10, 12-16, 18-20, 22-24, 26) gets no further
                      updates from Oracle. Plan a move to a supported release.
  Check               Version could not be confirmed precisely (version came from file properties; re-run with -VerifyWithJava).
  Unknown             The version could not be read.

IMPORTANT - what this is, and is not:
  * It is a version comparison only. It is NOT a vulnerability assessment: it does not name
    CVEs, rate severity, or know which vulnerabilities matter in your environment.
  * It works offline from a table inside the script. Oracle now ships security updates
    monthly, so the table goes out of date. The script warns when the table is more than 45
    days old. Check Oracle's Security Baseline page for the current versions.
  * Other vendors (Temurin, Corretto, Azul, Red Hat, Ubuntu and so on) number and time their
    builds differently and may carry fixes under other version numbers. For non-Oracle builds,
    "Behind latest" means "check your vendor's latest update", not "vulnerable".
  * Not being flagged does not mean an install is secure.

THE OUTPUT FILES
----------------
java-discovery-<COMPUTER>-<date-time>.csv           One row per Java installation found.
java-discovery-<COMPUTER>-<date-time>-summary.txt   Counts, run details and these caveats.

CSV columns:
  JavaExecutable / JavaHome   Where it is installed
  Kind                        JDK (has javac) or JRE
  Vendor, Version             From the release file / file properties (or java -version)
  VendorClass                 "Oracle-published", "Other vendor" or "Unknown"
  ReadFrom                    Which source the vendor/version came from
  PatchStatus / LatestKnown   Result of the patch-level check, and the latest known update for that line
  PatchNote                   Plain-English note on the result
  RunningNow                  Number of Java processes running from this install
  DetectedBy                  How the install was found

"Oracle-published" means the install reports Oracle as its vendor. That does NOT by itself
mean you need a licence, or that you do not. Oracle's terms depend on the version, the build,
how Java is used and the agreements you hold. This script cannot make that call.

The CSV lists computer names and folder paths. Treat it as internal information.


LIMITATIONS (PLEASE READ)
-------------------------
  * One computer at a time, common locations only. Java embedded in applications, portable
    copies in unusual folders, containers and other machines will be missed.
  * It does not measure usage, number of employees, processors/cores, or virtualisation,
    and it does not check commercial features. It does not assess vulnerabilities (the patch-level
    check is a version comparison only). Those are what a real licence position
    depends on.
  * A vendor of "Unknown" usually means an older install with no release file.
    Re-running with -VerifyWithJava often resolves it.
  * Results are indicative and may contain errors or omissions.


WHAT NEXT?
----------
  * Small estate (under about 500 machines)? Use the results as a starting point for your own
    review. The guides at https://www.jse-license.com explain Oracle's current Java rules.
  * Larger estate (500+ machines)? Lime Software offers a fixed-fee Java Licensing Risk Review:
    Oracle-verified collection tooling run inside your own network, an analyst-checked
    compliance report, and a 3PTV statement. Nothing leaves your network.
    Book or ask a question: https://www.jse-license.com  |  hello@jse-license.com
    We are happy to sign your NDA first. You do not have to send us this script's output.


LICENCE AND LIABILITY
---------------------
(c) Lime Software Ltd. You may use this script free of charge inside your own organisation.
You may not redistribute modified copies under the Lime Software or JSE-License name.
The script is provided "as is", without warranty of any kind. To the fullest extent
permitted by law, Lime Software Ltd accepts no liability for any loss or damage arising
from its use or from reliance on its output. No support is provided.
