Results 1 to 5 of 5
Thread: HelloWorldApp Error
- 05-27-2012, 03:44 PM #1
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
HelloWorldApp Error
Hey there!
I decided to give programming with Java a go and the first thing I wanted to do was this: "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application)
However, when I was about to compile my first file by typing javac HelloWorldApp.java I receive this error:
"'javac' is not recognized as an internal or external command, operable program or batch file"
According to the Common Problems Lesson I simply need to tell Windows where to find javac. In my case the directory would be:
C:\Program Files\Java\jdk1.7.0_04\bin\javac
But as soon as I precede javac with this directory I get the exact same message again.
Here's my Command Prompt log:
Any help is appreciated!Java Code:Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\iDGames>cd C:\Users\iDGames\Desktop\Java C:\Users\iDGames\Desktop\Java>dir Volume in drive C has no label. Volume Serial Number is D416-C70F Directory of C:\Users\iDGames\Desktop\Java 27.05.2012 15:26 <DIR> . 27.05.2012 15:26 <DIR> .. 27.05.2012 15:09 255 HelloWorldApp.java 1 File(s) 255 bytes 2 Dir(s) 310.412.894.208 bytes free C:\Users\iDGames\Desktop\Java>javac HelloWorldApp.java 'javac' is not recognized as an internal or external command, operable program or batch file. C:\Users\iDGames\Desktop\Java>C:\Program Files\Java\jdk1.7.0_04\bin\javac HelloW orldApp.java 'C:\Program' is not recognized as an internal or external command, operable program or batch file. C:\Users\iDGames\Desktop\Java>
- 05-27-2012, 04:00 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 05-27-2012, 04:07 PM #3
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
Re: HelloWorldApp Error
You're right about that. But the sample solution to compile the HelloWorldApp.java file is:
C:\jdk1.7.0\bin\javac HelloWorldApp.java
Wouldn't the equivalent for me be:
C:\Program Files\Java\jdk1.7.0_04\bin\javac HelloWorldApp.java
?
- 05-27-2012, 04:11 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: HelloWorldApp Error
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-27-2012, 07:10 PM #5
Member
- Join Date
- May 2012
- Posts
- 1
- Rep Power
- 0
Re: HelloWorldApp Error
In the My Compute Settings,goto Advanced and click on Environment Variables.If a variable named PATH already exists then add a semicolon to its end and the add "C:\Program Files\Java\jdk1.7.0_04\bin" (without the quotes) to it and click OK.If no PATH variable is present,then just click on New and put the same Location and click OK
Similar Threads
-
Could not find or load main class: c:\java\HelloWorldApp
By Atticus in forum New To JavaReplies: 10Last Post: 02-02-2012, 08:26 PM -
Error: Could not find or load main class HelloWorldApp (HELP)
By couch_mango in forum New To JavaReplies: 29Last Post: 02-02-2012, 08:23 PM -
errors while compiling a simple HelloWorldApp java program
By sripriya in forum New To JavaReplies: 10Last Post: 03-16-2011, 05:43 AM -
Help with compiling HelloWorldApp
By JonBrad in forum New To JavaReplies: 13Last Post: 01-09-2010, 04:04 PM -
Thread: Error 500--Internal Server Error java.lang.NullPointerException
By jackdear44 in forum New To JavaReplies: 1Last Post: 12-05-2009, 07:28 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks