Results 1 to 5 of 5
Thread: Javac Problems
- 10-28-2010, 01:23 AM #1
Member
- Join Date
- Oct 2010
- Posts
- 7
- Rep Power
- 0
Javac Problems
Alright so I've installed the JDK (1.6.0_22 to be exact) and I'm running windows 7. I've typed in to my command prompt
Java Code:javac -version
Java Code:file not found
".
What should I do from here to get it to work?
Cheers,
George
- 10-28-2010, 05:10 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,716
- Rep Power
- 19
So we can see what's going on, copy and post the entire output from:
Java Code:> dir > javac -version > javac example.java
"dir" is to check that example.java really does exist and is in the right place. You do have to run javac.exe from the right place so that it "sees" example.java.
- 10-28-2010, 05:18 AM #3
Member
- Join Date
- Oct 2010
- Posts
- 7
- Rep Power
- 0
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\George Kennedy>dir
Volume in drive C is Windows
Volume Serial Number is 3C2C-AC2E
Directory of C:\Users\George Kennedy
10/27/2010 08:15 PM <DIR> .
10/27/2010 08:15 PM <DIR> ..
10/17/2010 02:46 PM 145 .appletviewer
10/10/2010 07:39 PM <DIR> bluej
10/03/2010 11:07 AM <DIR> Contacts
10/27/2010 08:59 PM <DIR> Desktop
10/18/2010 11:18 PM <DIR> Documents
10/26/2010 11:40 PM <DIR> Downloads
10/03/2010 11:07 AM <DIR> Favorites
10/03/2010 11:07 AM <DIR> Links
10/03/2010 11:07 AM <DIR> Music
10/17/2010 02:19 PM <DIR> myfolder
10/03/2010 11:07 AM <DIR> Pictures
10/03/2010 11:07 AM <DIR> Saved Games
10/03/2010 11:07 AM <DIR> Searches
10/18/2010 11:33 PM <DIR> Videos
10/03/2010 11:07 AM <DIR> Virtual Machines
10/17/2010 02:43 PM <DIR> Week 02
1 File(s) 145 bytes
17 Dir(s) 449,938,161,664 bytes free
C:\Users\George Kennedy>javac -version
javac 1.6.0_22
C:\Users\George Kennedy>javac HelloWorld1.java
javac: file not found: HelloWorld1.java
Usage: javac <options> <source files>
use -help for a list of possible options
C:\Users\George Kennedy>
- 10-28-2010, 05:24 AM #4
Member
- Join Date
- Oct 2010
- Posts
- 7
- Rep Power
- 0
Thanks it worked i realized what i did
- 10-28-2010, 05:25 AM #5
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,716
- Rep Power
- 19
OK, so that explains the OS message: there is no HelloWorld1.java in the "C:\Users\George Kennedy" folder.
Navigate to the folder that contains the java file and try the javac command again.
[Edit]
Great! I'm glad you've got the compiler working. Now all you have to do is figure out the innumerable compiler messages that it will deliver you ;)
Similar Threads
-
Problems with javac
By gkoef in forum New To JavaReplies: 14Last Post: 09-07-2010, 10:17 AM -
javac
By PhilArmstrong in forum New To JavaReplies: 31Last Post: 11-21-2009, 03:46 PM -
javac?
By sardare in forum EclipseReplies: 1Last Post: 06-14-2008, 02:06 AM -
javac DOS
By rdunne in forum New To JavaReplies: 3Last Post: 01-01-2008, 11:49 AM -
Help with javaC
By Daniel in forum New To JavaReplies: 2Last Post: 07-04-2007, 02:44 PM
Bookmarks