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

unresolved module error in module-info.java #1021

Closed
OkonSamuel opened this issue Jun 15, 2021 · 3 comments
Closed

unresolved module error in module-info.java #1021

OkonSamuel opened this issue Jun 15, 2021 · 3 comments

Comments

@OkonSamuel
Copy link

[provide a description of the issue]

Trying to import external dependencies into a vscode java project having a module-info.java file and no build tool, causes unresolved errors in the module-info.java file. It seems module-info.class isnt being generated in the output folder.
image

 "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Launch Current File",
            "request": "launch",
            "mainClass": "${file}"
        },
        {
            "type": "java",
            "name": "Launch App1",
            "request": "launch",
            "mainClass": "mail/mypack.App",
            "vmArgs": "--module-path /home/okonsamuel/javafx-sdk-11.0.2/lib --add-modules javafx.controls "
        },
]

Adding module-path and reference libraries doesn't seem to help.
Everything works once I remove modules (i.e removing module-info.java) and use only packages in my project.

Environment
  • Operating System: Linux x86_64
  • JDK version: 11
  • Visual Studio Code version: 1.56.2
  • Java extension version: 0.16.0
  • Java Debugger extension version: 0.34.0
@testforstephen
Copy link
Contributor

You're accessing javafx through module, you can take a look at redhat-developer/vscode-java#881. Looks like you need to use a build tool such as gradle to manage the javafx library as module. You can post more discussion to the duplicated issue redhat-developer/vscode-java#881

@badis-zgh
Copy link

I have a problem and I hope you will help me, module-info.java does not exist in project Java I am using Visual Studio Code!

@testforstephen
Copy link
Contributor

@badis-zgh Could you please open a new issue? It's better to provide a sample project to help reproduce the issue? thanks.

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