• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java compile with package error: "javac: file not found: pkgname.Cname.java"  RSS feed

 
Jay Newberg
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a java source file called Cname.java that is in a folder called 'pkgname'. This folder resides in this path: C:\Users\jaynoob\Documents\JAVA. Inside "C:\Users\jaynoob\Documents\JAVA" I run the following command:

javac -cp "C:\Users\jaynoob\Documents\JAVA" pkgname.Cname.java

and receive the following error:

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

I'm guessing I'm probably doing this wrong. Any ideas why this won't compile?

Thanks for the help.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Specify the filename of the source file that you want to compile:

javac -cp "C:\Users\jaynoob\Documents\JAVA" pkgname\Cname.java

(assuming your current directory contains a directory names pkgname which contains a source file named Cname.java).
 
Jay Newberg
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help Jesper de Jong.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!