profesorfalken / jPowerShell

Simple Java API to interact with PowerShell console
Apache License 2.0
217 stars 84 forks source link

java.lang.NumberFormatException: For input string: "10136" #57

Closed wortner closed 5 years ago

wortner commented 5 years ago

I have problem using 'Get-Process' with jPowerShell on Win 10 JDK 11 getting Number format error. image. Nearly similar error I got using WMI4Java so I guess something wrong with my setup.

This is strange as the string contains additional data on the start (-1, -2 bytes). image Note: the process on which it fails seems always to be the powerShell process.

The stack trace is Exception in thread "main" java.lang.NumberFormatException: For input string: "10136" at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.base/java.lang.Long.parseLong(Long.java:692) at java.base/java.lang.Long.valueOf(Long.java:1144) at com.profesorfalken.jpowershell.PowerShell.initalize(PowerShell.java:168) at com.profesorfalken.jpowershell.PowerShell.openSession(PowerShell.java:129) at com.profesorfalken.jpowershell.PowerShell.openSession(PowerShell.java:108) at com.profesorfalken.jpowershell.PowerShell.executeSingleCommand(PowerShell.java:229)

profesorfalken commented 5 years ago

Hello,

I think this issue is related with #56. It is exactly the same line (PowerShell.java:168)

I close this one. Please follow #56 in order to get updates on the bug resolution.

Thanks and best regards