matlab-configure-java
Check which Java version MATLAB is using, switch it, or reset it without accidentally starting Java. Use this skill when a user wants to determine which Java/JDK/JRE version MATLAB is using, configure MATLAB to use a different JDK, or revert to the MATLAB default Java, or when a MATLAB script errors…
Install / Use
npx skills add matlab/matlab-agentic-toolkit --skill matlab-configure-javaInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of matlab-configure-java
matlab-configure-java scores 85/100 on our quality scale, 2709th of 4,651 Development & Engineering skills we index.
Its SKILL.md is 20 KB long, well organised into 11 sections with 2 code examples: a thorough specification that gives an agent plenty to work with.
With 1,098 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so matlab-configure-java is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
matlab-configure-java compared with similar skills
All 4 of these similar skills score higher than matlab-configure-java; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| matlab-configure-java (this skill)by matlab | 85 | 1.1k | 54d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 112.1k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 110.4k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.2k | 1d ago | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 70.6k | today | CLAUDE.md |
Frequently asked questions
- How do I install matlab-configure-java?
- Run
npx skills add matlab/matlab-agentic-toolkit --skill matlab-configure-java. The install tabs above show the steps for each supported agent. - Which AI agents does matlab-configure-java work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is matlab-configure-java safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is matlab-configure-java still maintained?
- The repository was last updated about 2 months ago, so matlab-configure-java is actively maintained.
Skill content
View source on GitHubname: matlab-configure-java description: > Check which Java version MATLAB is using, switch it, or reset it without accidentally starting Java. Use this skill when a user wants to determine which Java/JDK/JRE version MATLAB is using, configure MATLAB to use a different JDK, or revert to the MATLAB default Java, or when a MATLAB script errors on a java.* API call ("no runtime environment for Java applications has been found", "Unable to find Java library"). Covers jenv and matlab_jenv, R2025a+ dynamic loading, restart requirements based on Java load status, and release- and platform-specific reset behavior. Also handles installing OpenJDK (the MATLAB Add-Ons Explorer, Adoptium, or a command-line mpm install through matlab-core:matlab-install-products). license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md metadata: author: MathWorks version: "1.0"
Configure the MATLAB Java Runtime
Configure the MATLAB Java runtime by using jenv and matlab_jenv. For example, install OpenJDK after a java.* API failure, or select and switch to a specific JDK. The load status determines whether MATLAB requires a restart.
When to Use
- A MATLAB script errors on a
java.*API call with "no runtime environment for Java applications has been found" (R2026a and later) or "Unable to find Java library" (R2025a, R2025b). Error text often includes a link tomathworks.com/matlab-openjdk. - User asks "which Java version is my MATLAB session using?" or wants to check the current MATLAB Java configuration. This is a read-only question: answer it with
jenvalone (see Branch B step 1). - User wants to switch MATLAB to a specific Java version — "point MATLAB at the JDK at /path", "change Java version used by MATLAB", "switch MATLAB to Java 21".
- User wants to reset the MATLAB Java to the default. The reset command depends on release and platform (Branch B step 4).
When NOT to Use
If the user's request is about Java tooling outside MATLAB — compiling source with javac, building JARs, IDE Java configuration, OS-level JAVA_HOME for the terminal shell, or any other non-MATLAB Java toolchain — this skill does not apply. Exit silently with a minimal redirect: state briefly that the question is outside MATLAB Java-runtime setup, and point to general JDK / Java-toolchain documentation. Do NOT name jenv, matlab_jenv, MATLAB_JAVA, Adoptium, the Add-Ons Explorer, mathworks.com/matlab-openjdk, or any other mechanism from this skill — not even to disclaim them, and not in an "if you meant X instead" offer. Naming the tools of this skill in a response to a javac prompt implies MATLAB is involved even though it is not, which confuses the user rather than helping.
The javac boundary is the most-commonly-confused adjacent topic. If a prompt matches either of these shapes, treat it as out of scope:
- "How do I compile my Java code / class / program with
javac?" - "How do I build a JAR / set up a Java project / configure my Java IDE?"
Also out of scope:
- Installing a MathWorks support package (any product, not Java-specific). Use
matlab-core:matlab-install-products. This skill hands off to that skill only for a command-line (mpm) install of the OpenJDK support package in Branch A Option A. - Java errors with Java already loaded, or non-Java errors in the script. Use
matlab-core:matlab-debug-code. - Choosing a Databricks JDBC driver or adding a driver JAR. Use
matlab-connect-databricks. This skill handles only the Java runtime switch the driver might need. - Class-loading debugging inside a running Java-enabled MATLAB.
javaaddpath,ClassNotFoundException, and similar errors that occur after MATLAB has Java loaded are a different domain — the JVM is up, the classpath is wrong. - Non-Java MATLAB startup failures. License errors, corrupted preferences, install issues. Different failure mode.
Tool identity note: The MATLAB jenv command (introduced R2021b) is unrelated to the third-party shell tool github.com/jenv/jenv. This skill refers to the MATLAB jenv command only. Reading the current JavaEnvironment object (the Version/Home/Library/Status/Configuration fields this skill branches on) requires R2023a, when jenv gained its output-argument form.
Workflow — Branch A: Script Hits a Java API
Fires when a MATLAB script errors on a java.* call with the Java-runtime-not-found signature. See references/error-signatures.md for the verbatim error-text patterns per release.
-
Match the error text. Confirm it is the Java-runtime-not-found error (R2026a and later) or the "Unable to find Java library" error (R2025a, R2025b). If the error text does not match either signature, this skill does not apply — the failure is a different Java problem (class-loading,
javaaddpath, and so on). -
Present two install paths. Do not enumerate more.
- Option A — OpenJDK support package. The user installs it from the MATLAB Add-Ons Explorer. For a command-line install with
mpminstead, hand off tomatlab-core:matlab-install-products, then come back to step 3. - Option B — Adoptium system install (adoptium.net). Download a supported LTS JDK for the user's platform and install it.
You MUST quote the URL
https://www.mathworks.com/matlab-openjdkverbatim in your response as the source of truth for supported JDK versions. Do not paraphrase it as "the MathWorks supported-JDK page" or "the OpenJDK documentation" — output the full URL so the user can navigate to it. Do not invent per-release JDK-version claims ("R2026b requires Java 11", "JDK 21 support arrived in R2025a", and so on). If asked which JDK version to use, direct the user to the URL. - Option A — OpenJDK support package. The user installs it from the MATLAB Add-Ons Explorer. For a command-line install with
-
State the R2025a+ behavior positively. Tell the user:
On R2025a+, MATLAB auto-discovers a system-installed JDK and loads it dynamically on the next
java.*call. No MATLAB restart, no agent session restart, and nothing else to configure. Re-run the failing script. -
Re-run the script. The originally failing
java.*call now succeeds. -
Verify with
jenv. Calljenv(no arguments) viaevaluate_matlab_code. Read the five fields (Version,Home,Library,Status,Configuration). After the first successfuljava.*call,StatusisloadedandVersionnames the discovered JDK.
Workflow — Branch B: Choose or Switch Java Version
Fires on version-switch prompts ("switch to Java 21", "point MATLAB at /opt/jdk21", "which Java is MATLAB using?").
- Probe with
jenv(no args). Calljenvviaevaluate_matlab_code. Report all five fields —Version,Home,Library,Status,Configuration— verbatim to the user. Usejenvalone to inspect Java. It reads the configuration without starting the JVM. Calling any Java class or method from MATLAB starts the JVM, which flipsStatustoloadedand means any later switch needs a MATLAB restart. If the user asked only which Java is in use, report the fields and stop. - Read the
Statusfield. Consultreferences/load-status-check.mdfor the decision table. In short:Status: notloaded→ the new setting will be picked up on the nextjava.*call. No MATLAB restart required.Status: loaded→ MATLAB must be quit and relaunched to pick up the new JVM. In-process JVM swap is not supported.
- Recommend the switch call. Default to
jenv("/path/to/jdk")inside MATLAB. If the user prefers a shell workflow or MATLAB is not running, use the shell peer at<matlabroot>/bin/matlab_jenv /path/to/jdk. On Windows the shell peer is<matlabroot>\bin\matlab_jenv.bat. Always spell the executable exactly asmatlab_jenv— no other spelling of the shell peer is valid. Do not name any alternative form to the user, even to warn against it. These calls write the personal configuration; if an installation configuration is set, it wins (see step 4, Configuration levels). - Reset to the MATLAB default Java by clearing the configuration. If the user asks only how to reset or whether a reset command works, explain it; run it only when they ask you to. The MATLAB default Java is what it uses if neither level has a Java configuration (see Configuration levels below). Check the release with
isMATLABReleaseOlderThanand the platform withcomputer("arch")(maca64is Apple Silicon,maci64is Mac Intel). Neither call starts Java.- What the default is:
- R2026a and earlier on Windows, Linux, and Mac Intel (maci64): the MATLAB-shipped JRE.
- R2026a and earlier on Apple Silicon (maca64): system-installed Java. MATLAB has never shipped Java on Apple Silicon.
- R2026b and later on every platform: system-installed Java (via
JAVA_HOME/ OS default). MATLAB ships no Java from R2026b.
- R2026a and later, every platform: use
jenv("-clear"). It removes the personal configuration so MATLAB uses the default above. - R2025a and R2025b: on Windows, Linux, and Mac Intel, use
jenv("factory")to select the MATLAB-shipped JRE. On Apple Silicon there is no shipped JRE, so do not recommendjenv("factory"). Choose a JDK explicitly withjenv("/path/to/jdk"). - Configuration levels.
jenv(path),jenv("system"), andjenv("factory")write the personal configuration, andjenv("-clear")clears it.jenv("-allusers", path)(or"system"/"factory") writes the installation configuration for every user of that MATLAB installation, andjenv("-allusers", "-clear")clears it. If an installation configuration is set, it takes precedence over the personal one. So ifjenvstill reports the old Java after a personal switch orjenv("-clear"), one of two things is true: an installation configuration is in effect, or the default above is itself that Java (for example, the system's default JDK on Apple Silicon or on R2026b and later). Tell the user about both. If they want MATLAB to use a different Java, recommendjenv(path); do not suggest setting or changingJAVA_HOME. Recommendjenv("-allusers", "-clear")(orjenv("-allusers", path)) only after they confirm that changing Java for every user of the installation is what they want. - Restart rule is unchanged: a restart is required only if the current
Statusisloaded. jenvtreats any unrecognized string as a filesystem path, sojenv("default")errors with "Java folder default does not exist." Never suggestjenv("default").- The built-in
jenvhelp text on R2026a and R2026b does not match this behavior (for example, it says a restart is always required). Follow the rules in this step rather than re-checking the help text or the documentation.
- What the default is:
- Verify with
jenv(no args) — again. Do not useversion -javaas the verify step.jenvreports both the configured JRE and its load status in a single call;version -javareports only the version and does not indicate whether the swap requires a restart.
Key Functions
| Function | Purpose | Toolbox | Available From |
|----------|---------|---------|----------------|
| jenv (no args) | Report the current JavaEnvironment: Version, Home, Library, Status, Configuration. Primary probe and verify step. | (core MATLAB) | R2023a (object return) |
| jenv(path) | Configure MATLAB to use the JDK at path on the next java.* call. Restart required only if current Status: loaded. | (core MATLAB) | R2021b |
| jenv("factory") | Write the personal configuration to the MATLAB-shipped JRE. The reset to use on R2025a and R2025b on Windows, Linux, and Mac Intel (maci64). Not applicable on Apple Silicon (no shipped JRE). From R2026b it lands on system-installed Java. Restart required only if current Status: loaded. | (core MATLAB) | R2021b |
| `jenv("-
Truncated for display — read the full file on GitHub.
Related Skills
taste-skill
112.1kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
110.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
70.6kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
