I am using Visual Studio Code 0.9.2 for OS X Yosemite to edit a .java file.
I am trying to compile this file using the following tasks.json file:
{ "version": "0.1.0", "command": "javac", "isShellCommand": true, "echoCommand": true, "showOutput": "always", "args": ["-d","${workspaceRoot}\/target","${workspaceRoot}\/src\/*.java"] }
Performing this task redirects the following command to the output window:
running command$ javac -d /Users/caoimheboers/Desktop/JLab11/target /Users/caoimheboers/Desktop/JLab11/src/*.java
... which is good, however the result of the task is then reported as:
javac: file not found: /Users/caoimheboers/Desktop/JLab11/src/*.java Usage: javac <options> <source files> use -help for a list of possible options
I tried the following:
Copy the javac echo command (including all arguments) from the Output window and paste it into the command line in the terminal window. Result. One .java file in the / src folder compiles and a .class file appears in the / target folder. This indicates that the syntax of the javac command (including all arguments) is correct in the tasks.json file.
In the tasks.json file, replace the wildcard with the name of a single .java file in the / src folder. Result: the VS Code task works fine and creates a .class file in the / target folder. This means that everything about the command in the tasks.jason file is OK, except for the wildcard character.
Any ideas on what I'm doing wrong?
javac visual-studio-code macos
Martin
source share