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

Can not add additional classpath #1426

Open
demanLiu opened this issue Jan 10, 2024 · 7 comments
Open

Can not add additional classpath #1426

demanLiu opened this issue Jan 10, 2024 · 7 comments

Comments

@demanLiu
Copy link

[provide a description of the issue]

Environment
  • Operating System: wsl (Arch)
  • JDK version: 1.8
  • Visual Studio Code version: 1.85.1
  • Java extension version: v1.25.1
  • Java Debugger extension version: v0.55.0
Steps To Reproduce
  1. my launch.json
    {
    "type": "java",
    "name": "Application",
    "request": "launch",
    "mainClass": "Application",
    "projectName": "roc-domestic-web",
    "shortenCommandLine": "auto",
    "classPaths": [
    "$Auto",
    "~/workspace/domestic-shopping/roc-domestic-common/target/classes/",
    ],
    }

  2. launch command line
    /usr/bin/env /usr/lib/jvm/java-8-openjdk/jre/bin/java -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:41833 -cp /tmp/cp_aiaqxn8lxgly17gkhnct4os82.jar Application

Current Result

classpath can't have the classpath that I added

Expected Result

can append my customized classpath

@testforstephen
Copy link
Contributor

Can you replace "~" with the absolute path?

@demanLiu
Copy link
Author

no , I had tried it , absolute path is the same issue

@demanLiu
Copy link
Author

I know the reason , the classpath is written to MANIFEST.MF when ShortenCommandLine = 'jarmanifest', but I want to add additional classpath alone, like '-cp /tmp/cp_aiaqxn8lxgly17gkhnct4os82.jar;. xxx/', is it supported now?

@testforstephen
Copy link
Contributor

I want to add additional classpath alone, like '-cp /tmp/cp_aiaqxn8lxgly17gkhnct4os82.jar;. xxx/', is it supported now

Unfortunately, this feature is not supported. When the shortenCommandLine configuration is enabled, it will generate the complete classpath into a temporary file.

If you don't want it to be added to the tmp .jar, you can turn off the shortenCommandLine setting.

@demanLiu
Copy link
Author

If I turn off the shortenCommandLine setting, command line is to long , it can not run

@testforstephen
Copy link
Contributor

Could you please clarify why the default behavior, where the additional classpath is generated into the temporary .jar file, is not suitable for your needs?

@demanLiu
Copy link
Author

demanLiu commented Jan 10, 2024

Actually, I hope shortenCommonLine can support classpath file , like idea ,
image
because we have to read resource file in our project, if classpath is a jar, my project could not unzip it

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

No branches or pull requests

2 participants