• Post Reply Bookmark Topic Watch Topic
  • New Topic

javac not finding source files  RSS feed

 
Eric Racin
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In using javac, I have installed the JDK, set the PATH and JAVA_HOME. When I run this:
"C:\Program Files\Java\jdk1.8.0_40\bin\javac" -cp C:\G\j_javac\HTMLCarbonResults.java
I get: javac: no source files
Since I placed the source file path in the command line, I don't understand why it can't find the one .java file.
 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javac needs to know the source file it should act on. "-cp" is used to add to the classpath. If your source file doesn't need external libraries, just drop the "-cp".
 
Eric Racin
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great! that worked (taking out the -cp).
Any idea how to get rid of the "C:\Program Files\Java\jdk1.8.0_40\bin\
After all, I have that in my PATH
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can usually simply write javac. Just the 5 letters, then the names of the .java files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!