Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Junit project: Cannot determine executable for debug adapter '{0}' #167

Closed
bsaby opened this issue Nov 17, 2017 · 10 comments
Closed

Junit project: Cannot determine executable for debug adapter '{0}' #167

bsaby opened this issue Nov 17, 2017 · 10 comments
Assignees
Labels

Comments

@bsaby
Copy link
Contributor

bsaby commented Nov 17, 2017

Environment
  • win10 (x64/x86)
  • JDK version: 1.8.151_64, 1.8.151_86, 9.0.1_64
  • Visual Studio Code version: 1.18.1(32/64)
  • Java extension version: 0.14.0
  • Java Debugger extension version: 0.3.1
Steps To Reproduce
  1. Open vscode and open testcase 10. junit
  2. Open MyTest.java, and set breakpoint on line 10 and 16
  3. Start debug

[attach a sample project reproducing the error]
10.junit.zip

Current Result

image

@supersonicclay
Copy link

I have the same after updating to VSCode 1.18.1. I downgraded to VSCode 1.18.0, but am still experiencing the issue. My environment:

macOS Sierra: 10.12.6
VSCode: 1.18.1 and 1.18.0 (did not see the issue when on 1.18.0 prior to upgrade)

VSCode extensions:
redhat.java: 0.14.0
vscjava.vscode-java-debug: 0.3.1

java -version

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

@supersonicclay
Copy link

No idea why, but this fixed it for me.

  • Exit VS Code
  • rm -rf ~/Library/Application\ Support/Code/User/workspaceStorage/
  • Re-open VS Code

This is working with VS Code 1.18.1.

@testforstephen
Copy link
Contributor

testforstephen commented Nov 20, 2017

Reproduced this bug on my windows 10 machine.

I enabled the language server in debug mode, and found Build workspace command would get problem marker as follows:

[Marker [on: /10.junit, id: 3, type: org.eclipse.buildship.core.gradleprojectconfigurationmarker, attributes: [message: Missing Gradle project configuration folder: .settings, severity: 2], created: 11/20/17 10:50 AM]]

The java debugger just shows Build failed, please fix build error first., but doesn't show the problems on VSCode PROBLEMS view.

@ansyral Refer to the eclipse behavior, if there are problems in workspace, should pop up a message box to allow user to Proceed or Cancel the debugging operation instead of Just failed. Besides, should show the error information in VSCode PROBLEMS view.

@GrubbyHalo
Copy link

@testforstephen How do you enable the language server in debug mode ? I have the same error on my linux box. When i open up my project using eclipse i don't get any errors

@testforstephen
Copy link
Contributor

@GrubbyHalo There are two ways to launch language server in debug mode.

  1. java language server extension will detect if the extension is in development mode, if so, it will start with debug port localhost:1044 enabled.

so if i run java debugger in extension development mode, the language server will be in debug mode too.
image

You can download language server and java debug server source code from github, and attach to 1044 port to debug the extension code.

  1. The second way is a little hack.
    Find javaServerStarter.js under the directory C:\Users\jinbwan\.vscode\extensions\redhat.java-0.14.0\out\src\javaServerStarter.js, and modify const DEBUG = (typeof v8debug === 'object') || startedInDebugMode(); to const DEBUG = true;. Restart VSCode.

@GrubbyHalo
Copy link

Well this is bizarre. I fired up the extension in development mode and got the same error i got above while trying to debug it. No other meaningful messages. I then closed the extension dev host and on a whim removed the eclipse generated folders in my workspace (I used eclipse for this project before trying vscode) and tried debugging the project again and it worked! no error messages. I thought that maybe the eclipse generated folders might be responsible in some way for the errors so to test the theory i put them back again, but still got no errors! So now i am not sure what fixed it.

@testforstephen
Copy link
Contributor

@GrubbyHalo Refer to #170, @wokhan provides a workaround, that should work.

@wokhan
Copy link

wokhan commented Nov 22, 2017

@testforstephen In fact the workaround I reintroduced was already there in the previous version of the extension (0.3.0), and has been "removed" (i.e. uncommented) by @andxu for 0.3.1 when RedHat Java support extension was upgraded to 0.14, so I guess there was a good reason for this.

@yaohaizh
Copy link
Contributor

Fixed on PR: #176

@danvsantos
Copy link

danvsantos commented Feb 6, 2018

On windows 10 I solved it like this:

  • Remove Java Plugins from the folder ---> C:\Users\{Your user}\.vscode ;
  • And install plugins again

My version is 1.19.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants