tunnelvisionlabs/JavaForVS

Debugging AnyCPU requires a 64-bit JDK on 64-bit OS

Opened this issue · 0 comments

Currently, if you attempt to debug an application on a 64-bit OS use the Any CPU solution platform, and you only have a 32-bit JDK installed, the debugging operation will flash a window on the screen and then stop.

The problem stems from the fact that the debug launch algorithm automatically detects the appropriate version of the JDK to use (which may be a 32-bit JDK in this case), but does not then make sure and match the correct debug agent with the chosen runtime. In other words, when you try to debug this scenario, the Tvl.Java.DebugHostWrapperX64.dll agent is used with a 32-bit JDK.

The following workarounds are currently available:

  1. Use the X86 solution platform instead of Any CPU.
  2. Install a 64-bit JDK if you have a 64-bit operating system.

The debug agent filename is currently chosen by the following code:

bool x64 = Platform.EndsWith("X64", StringComparison.OrdinalIgnoreCase) || (Platform.EndsWith("Any CPU", StringComparison.OrdinalIgnoreCase) && Environment.Is64BitOperatingSystem);
string agentBaseFileName = "Tvl.Java.DebugHostWrapper";
if (x64)
agentBaseFileName += "X64";