#ProcessBuilder
Native dependencies are the part of your Java stack nobody owns
Most Java services I've looked at have at least one dependency that isn't really Java. It usually arrives as a wrapper: a JNI binding or a `ProcessBuilder` call around Ghostscript, a headless browser, ImageMagick or libvips. The Java side looks tidy, with a Maven coordinate and a sensible API. The part doing the actual work is a `.so` file or a binary on the PATH, and nobody on the team thinks of it as theirs. That's fine right up until it isn't. In my experience it stops being fine at one of three moments, and none of them are when you'd choose. ## The base image changes Someone moves the service to a slimmer container image to cut startup time or image size. Alpine is the classic choice, and Alpine uses musl instead of glibc. A native library built against glibc either refuses to load or loads and then behaves strangely, and the error you get is an `UnsatisfiedLinkError` that tells you almost nothing about why. The Java code didn't change and the JVM didn't care, but the binary underneath did. ## The CPU architecture changes A few years ago this was rare. Now half the developers on a team are on Apple Silicon laptops, and the cloud bill keeps nudging people toward ARM instances like AWS Graviton. The JDK has run on ARM for a long time, so pure Java code moves across without anyone noticing. A native dependency needs an ARM build to exist, to be packaged, and to be the same version as the x86 one you tested against. Sometimes all three are true. Often one isn't, and you find out in CI or, worse, on the first deploy. ## Someone publishes a CVE In September 2023, libwebp had a heap buffer overflow (CVE-2023-4863) that was being exploited in the wild. It was patched in Chrome quickly. It was patched much more slowly in everything else that had quietly bundled libwebp, which turned out to be a lot of things, including a lot of server-side image pipelines. If your image handling goes through a native library, patching means knowing that library is there, knowing which version you shipped, and rebuilding whatever image or package contains it. If it's a Java library, patching is a version bump in your build file, and your existing dependency scanning probably flagged it already. There's also a difference in how bad the bug is. A malformed file that triggers an out-of-bounds read in C is a potential remote code execution. The same malformed file in Java hits a bounds check and throws an exception. That's still a bug, and a crafted file can still cause a denial of service, but it's a much smaller category of bad day. ## The licensing question nobody asked Ghostscript is AGPL unless you buy a commercial license. That's a perfectly reasonable model, and Artifex is entitled to it, but I've seen it turn up in a dependency audit long after the service shipped, at which point the conversation involves lawyers instead of developers! Native tools tend to be pulled in by someone who needed it working by Friday, and license review doesn't always follow binaries the way it follows Maven dependencies. ## What pure Java costs you I'd be misrepresenting things if I said pure Java is free because it isn't! Somebody has to implement the format. The PDF specification is enormous, image formats are full of vendor quirks, and a native library that's been hammered on for twenty years has handled edge cases a newer implementation may not have met yet. Performance can also lag for some workloads, particularly where the native code leans on hand-tuned SIMD. The JDK itself doesn't help as much as you'd hope. ImageIO dates back to Java 1.4, picked up TIFF support in Java 9, and still has no built-in support for WebP, AVIF or HEIC. It also has habits that waste an afternoon, like `ImageIO.read` returning `null` when it can't find a reader instead of throwing, or rejecting CMYK JPEGs that every other tool opens without complaint. So "just use the JDK" often isn't an option, and you end up choosing between a native wrapper and a third-party Java library anyway. ## How to decide Before adding a native dependency, I'd want answers to a few things. Who updates it when a CVE lands, and how would we find out? Does it have builds for every OS, libc and CPU architecture we run on, including developer laptops? What happens to the JVM if it segfaults? (The answer is that the whole process dies and leaves an `hs_err_pid` file behind, which is a worse failure mode than an exception you can catch.) What's the license, and has anyone outside engineering looked at it? If those answers are all good, a native library will be the right call. Plenty of them are excellent. But the questions usually get asked after the first incident rather than before the first commit. _Disclosure: I work at a company that builds pure Java libraries for PDF and image processing, so I'm not neutral on this. The tradeoffs above apply regardless of whose library you use._
dev.to
November 6, 2026 at 2:35 PM
プログラマらしい記事を書いた-> JavaのProcessBuilderで外部アプリ(e.g. Python)と「継続的」に連携する方法
November 20, 2024 at 11:33 AM
JavaのProcessBuilderで.batファイルを起動してはいけない(destroy()で.batファイルから起動されるプロセスを殺せないため)。
November 20, 2024 at 6:15 AM
JavaでstanzaというPythonライブラリを使用するために使う方法について書いた -> JavaのProcessBuilderで外部アプリ(e.g. Python)と「継続的」に連携する方法 zenn.dev/lamrongol/ar...
JavaのProcessBuilderで外部アプリ(e.g. Python)と「継続的」に連携する方法
zenn.dev
September 8, 2024 at 10:36 PM
JavaのProcessBuilderで.batファイルを起動してはいけない(batファイルから起動されるプロセスを殺せないため)。
May 5, 2023 at 11:28 AM
🧟 ¡Cuidado! Java y el OS: Deadlocks, Zombies y el Muro de 64KB

https://dzone.com/articles/java-processbuilder-deadlocks-zombies

#Java #ProcessBuilder #Deadlock #Zombies
May 3, 2026 at 11:25 AM
Unveiling Command Injection Vulnerabilities in Java: Deep dive into ProcessBuilder and Runtime
Unveiling Command Injection Vulnerabilities in Java: Deep dive into ProcessBuilder and Runtime
Java’s ProcessBuilder and Runtime classes offer powerful functionality, but they also come with risks.
infosecwriteups.com
February 27, 2024 at 7:47 PM
4/ Instead of File and ProcessBuilder, we used:
• kotlinx-io for file I/O
• kmp-process to launch the processes
• Kotlin Coroutines instead of JVM threads
• expect/actual for platform bridges
The tooling is still evolving, but the results are solid.
April 16, 2025 at 1:02 PM
Master Shell Scheduling with DolphinScheduler and ProcessBuilder

Learn how to execute and monitor Shell scripts efficiently with sudo support, working directories, and full logging control.

#hackernews #news
Master Shell Scheduling with DolphinScheduler and ProcessBuilder
Learn how to execute and monitor Shell scripts efficiently with sudo support, working directories, and full logging control.
hackernoon.com
April 30, 2025 at 5:43 AM
@smarks.bsky.social
This would make me as the "nobody use that" user happy, because it feels so bad to access this via ProcessBuilder.
Withdrawn ticket in OpenJDK is here: bugs.openjdk.org/browse/JDK-8....
Loading...
bugs.openjdk.org
October 12, 2025 at 7:47 PM
in case it helps anyone

github.com/s5bug/wprocess

I built a proof of concept of how to get functionality like Linux's interpreters on Windows where .ps1 and .bat are properly interpreted
GitHub - s5bug/wprocess: proof of concept processbuilder wrapper for Java that handles .bat and .ps1
proof of concept processbuilder wrapper for Java that handles .bat and .ps1 - s5bug/wprocess
github.com
April 2, 2026 at 1:04 AM
CVE-2018-25159 - Epross AVCON6 OGNL Remote Code Execution via login.action
CVE ID : CVE-2018-25159

Published : March 11, 2026, 6:23 p.m. | 52 minutes ago

Description : Epross AVCON6 systems management platform contains an object-graph navigation language (OGNL) injection...
CVE-2018-25159 - Epross AVCON6 OGNL Remote Code Execution via login.action
Epross AVCON6 systems management platform contains an object-graph navigation language (OGNL) injection vulnerability that allows unauthenticated attackers to execute arbitrary commands by injecting malicious OGNL expressions. Attackers can send crafted requests to the login.action endpoint with OGNL payloads in the redirect parameter to instantiate ProcessBuilder objects and execute system commands …
cvefeed.io
March 11, 2026 at 8:04 PM
CVE-2026-67340 - ArcadeDB before 26.7.2 Remote Code Execution via Trigger Scripts
CVE ID : CVE-2026-67340

Published : Aug. 1, 2026, 1:17 p.m. | 25 minutes ago

Description : ArcadeDB before 26.7.2 (arcadedb-engine) allows trigger scripts to look up host classes in java.la...
CVE-2026-67340 - ArcadeDB before 26.7.2 Remote Code Execution via Trigger Scripts
ArcadeDB before 26.7.2 (arcadedb-engine) allows trigger scripts to look up host classes in java.lang.* (via Java.type) because ScriptTriggerExecutor adds java.lang.* to the allowed packages. An authenticated user with UPDATE_SCHEMA permission can create a JavaScript trigger that invokes java.lang.Runtime.getRuntime().exec() (or ProcessBuilder), achieving OS command execution when the trigger fires.
cvefeed.io
August 1, 2026 at 1:55 PM
Learn how to execute and monitor Shell scripts efficiently with sudo support, working directories, and full logging control. #apachedolphinscheduler
Master Shell Scheduling with DolphinScheduler and ProcessBuilder
hackernoon.com
April 29, 2025 at 9:06 AM
You can use a ProcessBuilder - it runs, but the problem is trying to get a result back into the Kotlin runtime environment. It seems like Python runs in its own container *within* the runtime as a subprocess, which creates a huge headache

It exists, but not sure if it was my best idea 😅
June 29, 2026 at 5:57 PM
Watching @mattbertuzzi present at @salesforce #MWUG on #ProcessBuilder magic. #awesomeadmin
November 27, 2024 at 8:54 PM
Eu usava muito o SOX e o MLT Framework para síntese de vídeo e áudio. E chamava usando o ProcessBuilder do Java.

www.baeldung.com/java-lang-pr...
Guide to java.lang.ProcessBuilder API | Baeldung
An in-depth look at using the ProcessBuilder API to manipulate OS processes
www.baeldung.com
August 20, 2025 at 10:40 PM
Which tool allows you to automate business processes without touching Apex code?
Drop your answer in the comments!

#Salesforce #SFDC #AdminQuiz #ProcessBuilder #Automation #Trailblazer #PeoplewooSkills
December 13, 2025 at 10:31 PM
Which tool allows you to automate business processes without touching Apex code?
Drop your answer in the comments!

#Salesforce #SFDC #AdminQuiz #ProcessBuilder #Automation #Trailblazer #PeoplewooSkills
December 11, 2025 at 6:30 PM
Under the hood, the Python SDK actually wraps a native Go binary!

The Antigravity Java SDK extracts this native harness, spawns it as a subprocess using Java 21 ProcessBuilder, and orchestrates agent turns over WebSockets.

Pure Java 21, virtual threads, and records! ☕
July 31, 2026 at 1:00 PM
LAStools: "DOSKEY" command wasn't found
A while ago I wrote the following Java 8 code on Win 10 to create an index file for a .laz file: Process p = null; ArrayList lines = new ArrayList(); String lasbinpath = "somepath\\LAStools\\bin"; String command = "lasindex64 -i someotherpath\\myfile.laz"; try { ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", command); Map env = builder.environment(); env.put("path", lasbinpath); builder.redirectErrorStream(true); p = builder.start(); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while(true) { line = br.readLine(); if (line==null) { break; } lines.add(line); } br.close(); } catch(IOException e) { e.printStackTrace(); } finally { if(p!=null) { p.destroy(); } } Recently I got a new Win 11 PC, installed the latest LAStools version (241017), the same Eclipse version (2020-06) and Java 8 on it and copied the old project. Yesterday I ran it once and it was working fine. Then I installed Miniconda but now it always returns an error: The "DOSKEY" command is either misspelled or could not be found. done with 'someotherpath\myfile.laz'. took 0.006 sec. It does create a .lax file (can't check if it's done correctly atm) but I've never seen this error before and definitely want to fix it. What I've already tried/checked: * Cleaned the project * Restarted Eclipse and my PC * The PATH (environmental variable) looks fine imo, only the "condabin" folder was added to it * The "doskey.exe" file exists in the "system32" folder * env.get("path") is null before I set it and it's got the correct path afterwards * When I copy this path into file explorer, it does lead to the "bin" folder, so the path is definitely correct. * The lasinfo64 command opens the lasinfo window but doesn't display anything (not sure what it should look like, as I've never used it before) and the same error is printed * Java is working fine otherwise and e.g. java -version prints the java version without any errors * I tested the same code in Eclipse 2025-09 with OpenSDK 24 and it's printing the same error * I added the path to PATH (system, not user) but it's still printing the same error The weird thing is, if I call it directly from cmd like this: cd someotherpath set path=C:\Sonstiges\RestBuero\LfU\LAZ\LAStools\bin;%path% lasindex64 -i myfile.laz ...then it works - no error. With the path added to PATH, I can omit the second line and it's still working (of course). What am I missing? Did Win 11 change how Eclipse can access the environmental variables? Is there anything I have to do/add to make it use LAStools correctly? Is this version of LAStools possibly bugged in a way?
gis.stackexchange.com
November 19, 2025 at 1:11 PM