• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Oracle Certified Associate Java SE 8 Programmer 1

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Going through the Western Governors University Software development program and it referred me to this site if I had any issues.

It's telling me to Create the two files:
C:\temp\packagea\ClassA.java
C:\temp\packageb\ClassB.java

I've done that. then in command prompt to navigate to the temp folder and run "javac packagea/ClassA.java packageb/ClassB.java" which I've done as well. I just get the message.
"javac: file not found: packagea\ClassA.java
Usage: javac <options> <source files>
use -help for a list of possible options"

It's supposed to compile and create two new files. packagea/ClassA.class and packageb/ClassB.class.

Any idea what's wrong here?
 
Enthuware Software Support
Posts: 4318
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Chris Christensen wrote:Going through the Western Governors University Software development program and it referred me to this site if I had any issues.

It's telling me to Create the two files:
C:\temp\packagea\ClassA.java
C:\temp\packageb\ClassB.java

I've done that. then in command prompt to navigate to the temp folder and run "javac packagea/ClassA.java packageb/ClassB.java" which I've done as well. I just get the message.
"javac: file not found: packagea\ClassA.java
Usage: javac <options> <source files>
use -help for a list of possible options"

It's supposed to compile and create two new files. packagea/ClassA.class and packageb/ClassB.class.

Any idea what's wrong here?


Try changing / to \ in your command and if it still doesn't work, put a dot \ in front like this:

javac .\packagea\ClassA.java .\packageb\ClassB.java
 
Marshal
Posts: 64666
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please explain whether you set a CLASSPATH environment variable when you installed Java®. A system CLASSPATH is usually more trouble than it is worth; it tends to produce the sort of problem you are experiencing
I am not convinced that C:\temp\... is the best place to store your work. I usually recommend you create a directory where the command line/terminal opens, as shown in this post.
Tell us what the following two instructions cause to print out: echo %CLASSPATH% and echo %PATH% Because you are getting that sort of error message, it is very likely that PATH will be set up correctly.
Try the following option to javac and later to java and see what happens: -cp .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!