Skip to content

Unable to start program if org.eclipse.debug.terminal is in the target platform #2428

@iloveeclipse

Description

@iloveeclipse

Latest master, on Windows 11.

  1. Import org.eclipse.debug.terminal into the workspace
  2. Start Eclipse from Eclipse
  3. Try to debug any trivial Java program like
import javax.swing.JOptionPane;
public class SomeClass {
	public static void main(String[] args) throws Exception {
		JOptionPane.showMessageDialog(null, "Hello, World!");
		while (true) {
			System.err.println(".");
			Thread.sleep(5000);
		}
	}
}

Error will be reported, nothing will be started.
Sometimes Console is opened & some process is shown in debugger but Console doesn't show any output, and debugger doesn't connect.

eclipse.buildId=4.39.0.I20260116-1800
java.version=25.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data C:\eclipse\workspaces\platform/../runtime-Java25 -dev file:///C:/eclipse/workspaces/platform/.metadata/.plugins/org.eclipse.pde.core/Java25/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

org.eclipse.jdt.launching
Error
Sun Jan 18 17:41:17 CET 2026
Cannot connect to VM

java.net.SocketException: Socket closed
	at java.base/sun.nio.ch.NioSocketImpl.endAccept(NioSocketImpl.java:685)
	at java.base/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:758)
	at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:593)
	at java.base/java.net.ServerSocket.platformImplAccept(ServerSocket.java:560)
	at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:536)
	at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:482)
	at java.base/java.net.ServerSocket.accept(ServerSocket.java:441)
	at org.eclipse.jdi.internal.connect.SocketTransportService.accept(SocketTransportService.java:91)
	at org.eclipse.jdi.internal.connect.SocketTransportImpl.accept(SocketTransportImpl.java:63)
	at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept(SocketListeningConnectorImpl.java:167)
	at org.eclipse.jdt.internal.launching.StandardVMDebugger$ConnectRunnable.run(StandardVMDebugger.java:113)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Image
  1. Close org.eclipse.debug.terminal project, restart Eclipse and run same config - everything works.
  2. Similar happens with the batch file executed as "external program"
@echo off
echo Hello World
pause

The change is related to 67a55ce / #1763.

What I miss is any reasonable possibility to disable this behavior from the launch configuration.

There is a new options group "Allocate console | Allocate terminal | Disable Input/Output" added in the launch config that probably is supposed to control this behavior, but it simply doesn't make any difference which option I select, nothing changes.

Image

Only way I found to "fix" the problem is to disable output merging which results in this code below executed that prevents PTY to be created:

https://github.com/eclipse-platform/eclipse.platform/blob/master/debug/org.eclipse.debug.terminal/src/org/eclipse/debug/terminal/PtyExecFactory.java#L33-L35

But this is surely not "right" way to deal with that problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions