Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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: 4428
41
  • 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: 69447
277
  • 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 .
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
Try Free Java/.NET Libraries for Word Excel PowerPoint and PDF
htttp://www.e-iceblue.com/free-apis.html
    Bookmark Topic Watch Topic
  • New Topic