| View previous topic :: View next topic |
| Author |
Message |
EliteLuver Cheater
Reputation: 0
Joined: 08 Jul 2007 Posts: 49 Location: Floating on that one cloud...
|
Posted: Tue Sep 04, 2007 9:16 pm Post subject: JAVA problem.... |
|
|
..So ima nub and I'm trying to learn Java.
I know I'm starting out with a hard language, but I think I can take it.
But so I make the "Hello World" application in Notepad.
Then, I go into Cmd prompt, and try to compile it using the "Javac HelloWorld.java" command
IT DONT BE WORKIN PEEPLES!
So if you guys could help me, with a STEP BY STEP guide, thanks.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Sep 04, 2007 9:20 pm Post subject: |
|
|
cd "file path"
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue Sep 04, 2007 9:23 pm Post subject: |
|
|
| YOU NEED TO BE MORE SPECIFIC THAN "IT DOES NOT WORK"
|
|
| Back to top |
|
 |
EliteLuver Cheater
Reputation: 0
Joined: 08 Jul 2007 Posts: 49 Location: Floating on that one cloud...
|
Posted: Tue Sep 04, 2007 9:23 pm Post subject: |
|
|
1 sec.
oh and appal - I dont think we've met. I'm AJ.
Im usually on the Runescape forums or the fagex forums...
But, uh, nice to meet you?
Ok, I enter the following:
| Code: |
public class HelloWorld
{
public static void main( String[] args )
{
System.out.println( "Hello world" );
}
} |
Then, i save it as a .java file.
I go into CMD Prompt, and type "cd desktop"
Then, I type in "javac HelloWorld.java"
_________________
|
|
| Back to top |
|
 |
zart Master Cheater
Reputation: 0
Joined: 20 Aug 2007 Posts: 351 Location: russia
|
Posted: Tue Sep 04, 2007 9:30 pm Post subject: |
|
|
And the error you receive is?
_________________
0x7A 0x61 0x72 0x74
TEAM RESURRECTiON |
|
| Back to top |
|
 |
EliteLuver Cheater
Reputation: 0
Joined: 08 Jul 2007 Posts: 49 Location: Floating on that one cloud...
|
Posted: Tue Sep 04, 2007 9:34 pm Post subject: |
|
|
'javac' is not recognized as an internal or external command, operable program or batch file."
Same thing as if you typed in askl;dghlkfhfd as a command.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Sep 04, 2007 9:58 pm Post subject: |
|
|
cd "C:\Documents and Settings\%username%\Desktop"
Javac HelloWorld.java
If it still doesn't work, I suggest putting it in the folder where your java compiler is. Then changing directories to there and trying to use "Javac HelloWorld.java"
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Programmer Cheater
Reputation: 0
Joined: 02 Sep 2007 Posts: 48
|
Posted: Wed Sep 05, 2007 4:56 am Post subject: |
|
|
Put it in the same folder as javac and try again -_-.
_________________
|
|
| Back to top |
|
 |
zart Master Cheater
Reputation: 0
Joined: 20 Aug 2007 Posts: 351 Location: russia
|
Posted: Wed Sep 05, 2007 7:57 am Post subject: |
|
|
| Programmer wrote: | | Put it in the same folder as javac and try again -_-. |
Exactly what he said, or navigate to your javac path and point to the directory of your file;
command C:\path\path\file.extension
It's not recognising your javac as a program since it's not in the directory of your code (or in the system directory)
_________________
0x7A 0x61 0x72 0x74
TEAM RESURRECTiON |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Wed Sep 05, 2007 8:10 am Post subject: |
|
|
or
winkey+pause/break -> advanced -> environment variables -> PATH
add the directory where javac resides to path (paths are seperated by semicolons); now you can use javac from anywhere.
|
|
| Back to top |
|
 |
EliteLuver Cheater
Reputation: 0
Joined: 08 Jul 2007 Posts: 49 Location: Floating on that one cloud...
|
Posted: Wed Sep 05, 2007 3:33 pm Post subject: |
|
|
Actually -
I fixed the problem (I think...)
WITH THE ALMIGHTY TEXTPAD!
_________________
|
|
| Back to top |
|
 |
|