Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 192 characters in body
Source Link
John Smith
  • 2.3k
  • 1
  • 15
  • 23

This seems to be a real issue with java and external processes

the following on windows 7 and java 7 (32bit)

ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); 

produces

SystemRoot: C:\Windows Path: xbox 

which means the running programs environment and the subprocesses environment should contain a path variable, that has exactly the value 'xbox' (e.g. nonsense, there is no directory named xbox anywhere on my pc)

just for protocol:

Map<String, String> env = System.getenv(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); 

gives exactly the same result.

when I run

b.command("convert.exe", "/?").inheritIO().start(); 

with this process builder and environment I get

 Konvertiert FAT-Volumes in NTFS. CONVERT Volume /FS:NTFS [/V] [/CvtArea:Dateiname] [/NoSecurity] [/X] Volume Bestimmt den Laufwerkbuchstaben (gefolgt von einem Doppelpunkt), den Bereitstellungspunkt oder das Volume. /FS:NTFS Bestimmt das in NTFS zu konvertierende Volume. /V Legt fest, dass CONVERT im ausf�hrlichen Modus ausgef�hrt wird. /CvtArea:Dateiname Bestimmt die zusammenh�ngende Datei im Stammverzeichnis, die als Platzhalter f�r NTFS-Systemdateien dienen soll. /NoSecurity Bestimmt die Sicherheitseinstellungen f�r konvertierte Dateien und Verzeichnisse, die f�r jeden Benutzer zug�nglich sind. /X Erzwingt ggf. das Aufheben der Bereitstellung. Alle ge�ffneten Handles auf das Volume sind in diesem Fall ung�ltig. 

this is the (german) output of

C:\Windows\System32\convert.exe 

The same happens when I use

Runtime.getRuntime().exec(new String[]{"convert.exe", "/?"}); 

And note that my environment is so small because I replaced the native enviroment. That means the whole program has exactly those two environment variables.

This seems to be a real issue with java and external processes

the following on windows 7 and java 7 (32bit)

ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); 

produces

SystemRoot: C:\Windows Path: xbox 

which means the running programs environment and the subprocesses environment should contain a path variable, that has exactly the value 'xbox' (e.g. nonsense, there is no directory named xbox anywhere on my pc)

when I run

b.command("convert.exe", "/?").inheritIO().start(); 

with this process builder and environment I get

 Konvertiert FAT-Volumes in NTFS. CONVERT Volume /FS:NTFS [/V] [/CvtArea:Dateiname] [/NoSecurity] [/X] Volume Bestimmt den Laufwerkbuchstaben (gefolgt von einem Doppelpunkt), den Bereitstellungspunkt oder das Volume. /FS:NTFS Bestimmt das in NTFS zu konvertierende Volume. /V Legt fest, dass CONVERT im ausf�hrlichen Modus ausgef�hrt wird. /CvtArea:Dateiname Bestimmt die zusammenh�ngende Datei im Stammverzeichnis, die als Platzhalter f�r NTFS-Systemdateien dienen soll. /NoSecurity Bestimmt die Sicherheitseinstellungen f�r konvertierte Dateien und Verzeichnisse, die f�r jeden Benutzer zug�nglich sind. /X Erzwingt ggf. das Aufheben der Bereitstellung. Alle ge�ffneten Handles auf das Volume sind in diesem Fall ung�ltig. 

this is the (german) output of

C:\Windows\System32\convert.exe 

The same happens when I use

Runtime.getRuntime().exec(new String[]{"convert.exe", "/?"}); 

And note that my environment is so small because I replaced the native enviroment. That means the whole program has exactly those two environment variables.

This seems to be a real issue with java and external processes

the following on windows 7 and java 7 (32bit)

ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); 

produces

SystemRoot: C:\Windows Path: xbox 

which means the running programs environment and the subprocesses environment should contain a path variable, that has exactly the value 'xbox' (e.g. nonsense, there is no directory named xbox anywhere on my pc)

just for protocol:

Map<String, String> env = System.getenv(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); 

gives exactly the same result.

when I run

b.command("convert.exe", "/?").inheritIO().start(); 

with this process builder and environment I get

 Konvertiert FAT-Volumes in NTFS. CONVERT Volume /FS:NTFS [/V] [/CvtArea:Dateiname] [/NoSecurity] [/X] Volume Bestimmt den Laufwerkbuchstaben (gefolgt von einem Doppelpunkt), den Bereitstellungspunkt oder das Volume. /FS:NTFS Bestimmt das in NTFS zu konvertierende Volume. /V Legt fest, dass CONVERT im ausf�hrlichen Modus ausgef�hrt wird. /CvtArea:Dateiname Bestimmt die zusammenh�ngende Datei im Stammverzeichnis, die als Platzhalter f�r NTFS-Systemdateien dienen soll. /NoSecurity Bestimmt die Sicherheitseinstellungen f�r konvertierte Dateien und Verzeichnisse, die f�r jeden Benutzer zug�nglich sind. /X Erzwingt ggf. das Aufheben der Bereitstellung. Alle ge�ffneten Handles auf das Volume sind in diesem Fall ung�ltig. 

this is the (german) output of

C:\Windows\System32\convert.exe 

The same happens when I use

Runtime.getRuntime().exec(new String[]{"convert.exe", "/?"}); 

And note that my environment is so small because I replaced the native enviroment. That means the whole program has exactly those two environment variables.

added 1377 characters in body
Source Link
John Smith
  • 2.3k
  • 1
  • 15
  • 23

This seems to babe a real java issue: with java and external processes

the following on windows ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key 7 and java 7 : env.keySet()32bit) System.out.println(key + ": " + env.get

ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); 

produces

SystemRoot: C:\Windows Path: xbox 

which means the running programs environment and the subprocesses environment should contain a path variable, that has exactly the value 'xbox' (key)); be.command("convertg.exe" nonsense, "/?"there is no directory named xbox anywhere on my pc).inheritIO

when I run

b.command("convert.exe", "/?").inheritIO().start(); 

with this process builder and environment I get

 Konvertiert FAT-Volumes in NTFS. CONVERT Volume /FS:NTFS [/V] [/CvtArea:Dateiname] [/NoSecurity] [/X] Volume Bestimmt den Laufwerkbuchstaben (gefolgt von einem Doppelpunkt), den Bereitstellungspunkt oder das Volume. /FS:NTFS Bestimmt das in NTFS zu konvertierende Volume. /V Legt fest, dass CONVERT im ausf�hrlichen Modus ausgef�hrt wird. /CvtArea:Dateiname Bestimmt die zusammenh�ngende Datei im Stammverzeichnis, die als Platzhalter f�r NTFS-Systemdateien dienen soll. /NoSecurity Bestimmt die Sicherheitseinstellungen f�r konvertierte Dateien und Verzeichnisse, die f�r jeden Benutzer zug�nglich sind. /X Erzwingt ggf. das Aufheben der Bereitstellung. Alle ge�ffneten Handles auf das Volume sind in diesem Fall ung�ltig. 

this is the (german) output of

C:\Windows\System32\convert.exe 

The same happens when I use

Runtime.getRuntime().exec(new String[]{"convert.exe", "/?"}); 

And note that my environment is so small because I replaced the native enviroment.start(); That means the whole program has exactly those two environment variables.

This seems to ba a real java issue:

the following on windows ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); b.command("convert.exe", "/?").inheritIO().start();

This seems to be a real issue with java and external processes

the following on windows 7 and java 7 (32bit)

ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); 

produces

SystemRoot: C:\Windows Path: xbox 

which means the running programs environment and the subprocesses environment should contain a path variable, that has exactly the value 'xbox' (e.g. nonsense, there is no directory named xbox anywhere on my pc)

when I run

b.command("convert.exe", "/?").inheritIO().start(); 

with this process builder and environment I get

 Konvertiert FAT-Volumes in NTFS. CONVERT Volume /FS:NTFS [/V] [/CvtArea:Dateiname] [/NoSecurity] [/X] Volume Bestimmt den Laufwerkbuchstaben (gefolgt von einem Doppelpunkt), den Bereitstellungspunkt oder das Volume. /FS:NTFS Bestimmt das in NTFS zu konvertierende Volume. /V Legt fest, dass CONVERT im ausf�hrlichen Modus ausgef�hrt wird. /CvtArea:Dateiname Bestimmt die zusammenh�ngende Datei im Stammverzeichnis, die als Platzhalter f�r NTFS-Systemdateien dienen soll. /NoSecurity Bestimmt die Sicherheitseinstellungen f�r konvertierte Dateien und Verzeichnisse, die f�r jeden Benutzer zug�nglich sind. /X Erzwingt ggf. das Aufheben der Bereitstellung. Alle ge�ffneten Handles auf das Volume sind in diesem Fall ung�ltig. 

this is the (german) output of

C:\Windows\System32\convert.exe 

The same happens when I use

Runtime.getRuntime().exec(new String[]{"convert.exe", "/?"}); 

And note that my environment is so small because I replaced the native enviroment. That means the whole program has exactly those two environment variables.

Source Link
John Smith
  • 2.3k
  • 1
  • 15
  • 23

This seems to ba a real java issue:

the following on windows ProcessBuilder b = new ProcessBuilder(); Map<String, String> env = b.environment(); for (String key : env.keySet()) System.out.println(key + ": " + env.get(key)); b.command("convert.exe", "/?").inheritIO().start();