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

Bug - Java Default Launch configuration Not Working #1229

Closed
mamilic opened this issue Aug 30, 2023 · 10 comments
Closed

Bug - Java Default Launch configuration Not Working #1229

mamilic opened this issue Aug 30, 2023 · 10 comments
Assignees

Comments

@mamilic
Copy link

mamilic commented Aug 30, 2023

Type: Bug

I am using the gradle dependency management tool with Spring Boot, however when I try to build and run application it does not use default gradle output dir which is "build", instead it uses "bin", and on top of that it is compiling all the code, tests and main.

Expected Beahviour
The Java Launch configuration should use Gradle default config to build and run the app.

VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:18:39.991Z)
OS version: Linux x64 6.4.12-zen1-1-zen
Modes:

System Info
Item Value
CPUs AMD Ryzen 5 PRO 4650U with Radeon Graphics (12 x 1397)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 10, 3, 1
Memory (System) 38.55GB (32.23GB free)
Process Argv
Screen Reader no
VM 0%
DESKTOP_SESSION gnome
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome
XDG_SESSION_TYPE wayland
Extensions (28)
Extension Author (truncated) Version
swagger-viewer Arj 3.1.2
path-intellisense chr 2.8.4
EditorConfig Edi 0.16.4
shell-format fox 7.2.5
kotlin fwc 0.2.31
copilot Git 1.106.367
copilot-chat Git 0.6.0
vscode-auto-open-markdown-preview hnw 0.0.4
Kotlin mat 1.7.1
vscode-docker ms- 1.26.0
vscode-kubernetes-tools ms- 1.3.13
sqltools mtx 0.28.0
java red 1.21.0
vscode-xml red 0.26.1
vscode-yaml red 1.14.0
sonarlint-vscode Son 3.20.2
vscode-h2o tet 0.2.11
shellcheck tim 0.34.0
intellicode-api-usage-examples Vis 0.2.8
vscodeintellicode Vis 1.2.30
vscodeintellicode-completions Vis 1.0.22
vscode-gradle vsc 3.12.7
vscode-java-debug vsc 0.54.0
vscode-java-dependency vsc 0.23.1
vscode-java-pack vsc 0.25.13
vscode-java-test vsc 0.39.1
vscode-maven vsc 0.42.0
gitblame wad 10.5.0
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30803844
282f8724:30602487
f6dab269:30613381
a9j8j154:30646983
showlangstatbar:30737416
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofa:30804715
pythonnosmt12:30797651
pythonidxptcf:30805731
pythonnoceb:30805159
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572

@testforstephen
Copy link
Contributor

@jdneo is working on reusing "build" directory as gradle output in Java extension. He can share more information on how to enable it.

@jdneo
Copy link
Member

jdneo commented Sep 15, 2023

Hi,

You can try the new Gradle support approach with following steps:

  • install the latest pre-release of Gradle for Java extension
    Picture1
  • Run Java: Clean Java Language Server Workspace > Reload and Delete
  • After reload, if you still see
    image
    in the Java Projects explorer, it indicates that the project is still imported by Buildship, you need to clean and reload again. (This is caused by some issues that the bundle is not registered for the first time in a new workspace)
  • You should see logs
    image
    in those two output channel if the new importer is working.

The new approach will delegate the build job to Gradle. The java extension is not responsible to generate .class files anymore. Gradle build tool will be used to do the compilation.

@mamilic
Copy link
Author

mamilic commented Sep 15, 2023

Wow, awesome. Will give it a try, could you share MR that implements this? Thanks a lot.

@jdneo
Copy link
Member

jdneo commented Sep 16, 2023

Hi @milic-marko, do you mean the repo link of the implementation?

@mamilic
Copy link
Author

mamilic commented Sep 17, 2023

Hi, that's right. Do you jave MR/PR for this functionality?

@jdneo
Copy link
Member

jdneo commented Sep 18, 2023

The implementation has two parts: client side and server side.

The client part implementation is here: https://github.com/microsoft/vscode-gradle/tree/develop/extension/jdtls.ext/com.microsoft.gradle.bs.importer

The server side implementation is not public now, but we will make it public very soon.

@mamilic
Copy link
Author

mamilic commented Sep 18, 2023

Thank you very much. Cheers.

@jdneo
Copy link
Member

jdneo commented Sep 19, 2023

BTW, does this new approach solve your problem?

@mamilic
Copy link
Author

mamilic commented Sep 19, 2023

Yes, this issue can be closed. Just wondering, when the feature will be released in regular non pre release channel?

@jdneo
Copy link
Member

jdneo commented Sep 19, 2023

when the feature will be released in regular non pre release channel?

Around the end of this month.

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

No branches or pull requests

3 participants