I have this command to get output from a program:
project_path/data $ java -classpath ../jars/jdom.jar:[etc, more jars] path/to/class/MainClass config.xml command arg1 arg2
When I do this, I get the output I expect. But I want to be able to debug it so I can step through as the code runs.
So I tried making a launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"request": "launch",
"name": "Run Project",
"cwd": "${workspaceRoot}/data",
"mainClass": "path.to.class.MainClass",
"args": ["config.xml", "command", "arg1", "arg2"]
},
]
}
However, when I do it this way I always get an error that the config file cannot be found, so it seems like something about the paths is not being resolved the same way when I run a JVM directly from the terminal as when I try to call the class directly with a launch.json
, but because I'm not super familiar with Java I don't know how to fix this.