problem with sourcepath option

G

gordon

newbie doubt..pls forgive

I have a .java file
org.mypackage.PathTest.java
in F:\my\code\src folder

I want to compile this file from another directory,say
E:\newdir.

I tried like this in command prompt

E:\newdir> javac org/mypackage/PathTest.java -sourcepath F:\my\code
\src

Still,it causes a file not found message like
file not found: org\mypackage\PathTest.java
Can someone tell me the correct usage

thanks
gordon
 
J

John B. Matthews

gordon said:
newbie doubt..pls forgive

I have a .java file
org.mypackage.PathTest.java
in F:\my\code\src folder

I want to compile this file from another directory,say
E:\newdir.

I tried like this in command prompt

E:\newdir> javac org/mypackage/PathTest.java -sourcepath F:\my\code
\src

Still, it causes a file not found message like
file not found: org\mypackage\PathTest.java
Can someone tell me the correct usage

Usage: javac <options> <source files>

You have specified a sourcepath among the <options>, but not the
required <source files>. For example, on my OS:

javac -sourcepath news news/PathTest.java

IIUC, on your OS:

javac -sourcepath F:\my\code\src F:\my\code\src\org\mypackage\PathTest.java
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top