Does javac sourcepath work?

I'm trying to use javac -sourcepath, but I feel like I'm doing something really stupid.

[leoks@x ~]$ pwd
/home/leoks

[leoks@x ~]$ /opt/jdk1.7.0_40/bin/javac -sourcepath /home/leoks/EclipseIndigo/workspace2/sand/src/ Hello.java
javac: file not found: Hello.java
Usage: javac <options> <source files>
use -help for a list of possible options

[leoks@x ~]$ /opt/jdk1.7.0_40/bin/javac             /home/leoks/EclipseIndigo/workspace2/sand/src/Hello.java

[leoks@x ~]$ /opt/jdk1.7.0_40/bin/javac -help
Usage: javac <options> <source files>
where possible options include:
(...)
-sourcepath <path>         Specify where to find input source files

I know that no one uses this parameter, but does this parameter not work? Or am I missing something here?

+4
source share
1 answer

Put your source in the package and try again:

[leoks@x ~]$ /opt/jdk1.7.0_40/bin/javac -sourcepath /home/leoks/EclipseIndigo/workspace2/sand/src/ t/Hello.java

Wrong to apply classes in default package.

+2
source

Source: https://habr.com/ru/post/1527891/


All Articles