Open Arebusf21 opened 4 weeks ago
Hi @Arebusf21. Thank you for reaching out. I am sorry for the late response.
The main reason that the compiler does not find the library jar which contains the package referenced in the code is that jar files that are being added manually to the class-path should be named explicitly. In your example, this would mean explicitly writing ClassTest.jar when adding it to the --class-path
option in Run Configuration > VM Options or the CLASSPATH
Environment.
The *
glob/wildcard character works on the command-line java utility in a shell or cmd prompt. In Java 8 and below, i.e. prior to JDK 10 (and some later versions of JDK 9), only the shell would expand the wildcards on the command-line. However, since then the java CLI tools do apply wildcard expansion internally, to improve the user experience. If you would like, we could mark this as an enhancement request to support wildcards in the class-path options manually supplied. I request your feedback on this.
Please let us know if you are able to continue with your work, in the current version of the extension, by specifying the jar file in the classpath in the Run Configurations. Thanks.
Hi: I get a "Package does not exist" error when compiling and running my App. Even though the code compiles and runs ok, this is still an issue worth looking into as the extension is pretty useless with your code littered with error messages! It's a very simple app written to test the extension. I still get the error even when I copy the library to the working folder.
I have noticed that the error messages are a result of background scanning of code by netBeans? nbjrt...
Environment: Windows 10. VSCode: 1.95.0 Oracle Java Extension: 23.0.0 I have set the run configuration environment variable: CLASSPATH to point to my .jar file. the compiler can find it ok. settings.json file: { "jdk.project.jdkhome": "f:\program files\java\jdk-17", "jdk.verbose": true, "jdk.runConfig.env": "CLASSPATH=e:\dev\java\lib\*" }
here is my source: HelloWorld.zip
Error Messages reported by the Linter: Messages.txt