Skip to content

Launching apps which require both, a modulepath and a classpath dosen't work with shortenCommandLine="argfile" #1047

@rbi

Description

@rbi

Launching apps which require both, a modulepath and a classpath dosen't work with shortenCommandLine="argfile"

Environment
  • Operating System: Ubuntu 20.04
  • JDK version: AdoptOpenJDK 11.0.11
  • Visual Studio Code version: VSCodium 1.59.1
  • Java extension version: Language Support for Java(TM) by Red Hat v0.81.0
  • Java Debugger extension version: v0.34.0
Steps To Reproduce
  1. Create an app with Maven with a module-info.java. It should have both: module-path dependencies and class-path dependencies.
  2. Click on "Run" on the main method or create a launch configuration with shortenCommandLine="argfile"

I have created a demo project here:
https://github.com/rbi/vscode-modular-java/blob/master/.vscode/launch.json

Use the launch configuration "Launch Demo - not working with shortenCommandLine=argfile". In that project log4j-api is a module-path dependency and log4j-core is classpath dependency.

Current Result

Only module-path dependencies are added to the argfile. Classpath dependencies are not added.

In the demo project this results in:
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath.
although log4j-core is in the pom.xml.

Expected Result

It should add both, modulepath and classpath to the argfile. shortenCommandLine="argfile" seams to be the default when just clicking on the gray little "Run" over the main method so it would be great if it would work.

In the demo project you should something like the following on the command line.
[INFO ] 2021-09-07 19:44:26,063 de.bieniek_it.vscode_modular_java.Demo - Hello World!

Workaround

Use shortenCommandLine="none"

In the demo project you can use the second launch configuration "Launch Demo - working with shortenCommandLine=none".

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions