javac找不到源文件
问题描述:
我在当前工作目录中有 .java
文件,但是javac报告:
I have the .java
file on the current working directory but javac reports:
javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options
我正在研究ubuntu。
I'm working on ubuntu.
答
从上面的评论中看起来你尝试过:
From your comment above, it looks like you tried:
你的Ubuntu系统上的 javac -cp .; lib.jar a.java
。 Unix系统上的 CLASSPATH
分隔符是:
,;
on Windows。
javac -cp .;lib.jar a.java
on your Ubuntu system. The CLASSPATH
separator is :
on Unix systems and ;
on Windows.
Ubuntu将命令视为;
, java -cp。
并因此给出了消息。
Ubuntu considered the command up to the ;
, java -cp .
and thus gave the message.
javac -cp。:lib.jar a.java
应该编译好。