0

I set up a folder containing a test java file that only contains the word "test". I want docker to compile it. To run it, I call

$ docker run -it -v ~/my/path/testpayload:/payload -w /payload test_docker javac -cp /usr/share/java/*:. *.java

However, I get the following error

javac: file not found: *.java
Usage: javac <options> <source files>
use -help for a list of possible options

If I explicitly state the name of the java file like so:

$ docker run -it -v ~/my/path/testpayload:/payload -w /payload test_docker javac -cp /usr/share/java/*:. TestPayload.java

It tries to compile and returns with the expected error:

TestPayload.java:1: error: reached end of file while parsing
test
^
1 error

I tried it again with the wildcard but without the classpath and it still doesn't work, which makes me think it's something with the wildcard, I googled but it seems to me like I'm using the wildcard correctly.

Thanks.

user36322
  • 241
  • 3
  • 13

0 Answers0