Vscode-java-debug: ArgumentOutOfRangeException on Clicking Run or Debug under main function

Created on 26 Aug 2019  ·  7Comments  ·  Source: microsoft/vscode-java-debug

When clicking Run or Debug above the main function in a java file, results in ArgumentOutOfRangeException exception.

Environment
  • Operating System: Windows 10 x64
  • JDK version: 12
  • Visual Studio Code version:
Version: 1.38.0-insider (user setup)
Commit: 185308c0dd317d73fe4c19dea347582dee9650de
Date: 2019-08-26T09:46:11.283Z
Electron: 4.2.9
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362
  • Java extension version: 0.47.0
  • Java Debugger extension version: 0.21.0
Steps To Reproduce
  1. Open a java file with a main function.
  2. Click Run or Debug above the main function.

Repro project: here

Current Result

ArgumentOutOfRange Exception:

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -5.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
Expected Result

No exception

Additional Informations
terminal

Most helpful comment

Try setting the console to internalconsole instead of integratedterminal

All 7 comments

Try setting the console to internalconsole instead of integratedterminal

we have released a new version 0.22.0, it's supposed to mitigate the terminal issue. Could you have a try?

I am afraid, with java.debug.settings.console set to integratedterminal, the previous incorrect behavior still exists, in a different form:

& 'C:\Users\username\.vscode-insiders\extensions\vscjava.vscode-java-debug-0.22.0\scripts\launcher.bat' 'C:\Program Files\AdoptOpenJDK\jdk-13.0.0.33-hotspot\\bin\java' '-Dfile.encoding=UTF-8' '-cp' 'G:\dev\_my-projects\someproject\bin\test' 'abcd.pqrs.someproblem.Solution'

I was not expecting the above to be printed out.

i didn't understand what error you got. Could you share the whole screenshot of your terminal window?

This is on clicking Run:

image

Thanks, i got your problem. This is the expected behavior to print the command line.

If you want not to show the program command line, you can change the java.debug.settings.console to internalConsole or externalTerminal

Was this page helpful?
0 / 5 - 0 ratings

Related issues

testforstephen picture testforstephen  ·  4Comments

spottedmahn picture spottedmahn  ·  6Comments

gcbartlett picture gcbartlett  ·  3Comments

radu-ion picture radu-ion  ·  5Comments

srfrnk picture srfrnk  ·  5Comments