redhat-developer / redhat-developer/vscode-java

_ is not on the classpath of project _, only syntax errors are reported

Open
#1,886 19 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Every time I try to create a package for my java classes so I can finish my projects for school, errors like this occur:
image
When I finally try to run the program, I get an even more infuriating message:
image
It hurts me to be unable to properly test my code, even if I know I did well. It has been giving me anxiety for quite a while now, so I'm quite surprised this has slipped under the radar for so long.

  • Operating System:
    image

  • JDK version: 15.0.2

  • Visual Studio Code version:
    image

  • Java extension version:
    image
    image

Steps To Reproduce

  1. Create a java class with methods and everything.
  2. Put it in a folder with a test program.
  3. List the folder as a package in both programs.
  4. Try to use the class and it's methods in the test program. Both errors should be clearly visible by now.

Here is my code as an example of what can cause it. Try compiling either Test.java or Customer.java and it should be quite apparent.
Chapter10.zip

Current Result

A warning that constantly results in weird compiler errors

Expected Result

A working class that I can use

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.

Research direction

Start by opening the attached Chapter10.zip and reproducing the report with Test.java and Customer.java in VS Code using JDK 15.0.2. Check the Java extension's handling of the package and classpath setup. Done means the classpath warning is resolved and the example classes compile and run as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.