I am trying to run my program in command prompt using -classpath override. Take a look at what i tried here, and what resulted when I tried to give the classpath from a higher root directory. I am wondering why it can't find the file.
C:\Program Files\Java\src\com\scjaexam>dir Volume in drive C is OS Volume Serial Number is 8873-03A4 Directory of C:\Program Files\Java\src\com\scjaexam 12/06/2011 01:38 PM <DIR> . 12/06/2011 01:38 PM <DIR> .. 12/06/2011 01:42 PM <DIR> ex2_1 11/17/2011 12:49 PM <DIR> tutorial 0 File(s) 0 bytes 4 Dir(s) 112,734,724,096 bytes free C:\Program Files\Java\src\com\scjaexam>cd ex2_1 C:\Program Files\Java\src\com\scjaexam\ex2_1>dir Volume in drive C is OS Volume Serial Number is 8873-03A4 Directory of C:\Program Files\Java\src\com\scjaexam\ex2_1 12/06/2011 01:42 PM <DIR> . 12/06/2011 01:42 PM <DIR> .. 12/09/2011 11:14 AM 82 iterator.java 1 File(s) 82 bytes 2 Dir(s) 112,734,724,096 bytes free C:\Program Files\Java\src\com\scjaexam\ex2_1>javac -cp iterator.java javac: no source files Usage: javac <options> <source files> use -help for a list of possible options C:\Program Files\Java\src\com\scjaexam\ex2_1>javac -cp . iterator.java iterator.java:1: ';' expected package com.scjaexam.ex2_1 ^ 1 error C:\Program Files\Java\src\com\scjaexam\ex2_1>javac iterator.java iterator.java:1: ';' expected package com.scjaexam.ex2_1 ^ 1 error C:\Program Files\Java\src\com\scjaexam\ex2_1>cd..\..\.. C:\Program Files\Java\src>javac -cp .\com\scjaexam\ex2_1 iterator.java javac: file not found: iterator.java Usage: javac <options> <source files> use -help for a list of possible options C:\Program Files\Java\src>