redhat-developer / redhat-developer/vscode-java

Classes compile outside vscode in CLI, but in vs-code problem section displays errors and editor highlights code lines in red

Open
#1,531 18 comments 0 reactions 1 assignee View on GitHub

@snjeza is already working on this.

Since Nov 4, 2020.

compile Gradle upstream
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

Java Code is compiling neatly, outside the Vs-Code IDE i.e., from command line and other IDE's like IntelliJ, but when I import my project into VS-Code there are some errors displayed in problems section. Some of them are shown here with screenshots

Environment
  • Operating System: Windows 10
  • JDK version: 1.8 - J9 VM
  • Visual Studio Code version: 1.47.2
  • Java extension version: v0.64
  • Build tool: Gradle, wrapper version, 4.8.1
Steps To Reproduce the
  1. Create a project having src/main/resources and add your java code directly inside src\main
  2. Java Model Exception: Java Model Status [Cannot nest '<project>/src/main/resources' inside '<project>/src/main'. To enable the nesting exclude 'resources/' from 'junit_tests/src/main']
Current Result
  • Below is the Java language server log file excerpt
    image

  • I have tried excluding the resources folder, but no luck, problems section still has this.

  • All these compile times issues or problems shown in the problems section in vsc-code are not detected in IntelliJ IDE. Not sure why the is is happening.

  • The code/java intellisense cannot trace the relationship between so, red marks with lines highlighted is shown, but actually that's not the case, as the classes are compiled perfectly from command line.

  • Some of the compiler issues, shown in the problems section are
    -2-another-problem-shown-in-vscode

  • 3-failed-to-configure-project

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.