Java Compiler

Discuss all aspects of programming here.

Moderator: The Mod Squad

Java Compiler

Postby Empyre » Thu Dec 16, 2010 10:09 pm

Hello all. This is an extremely basic question but here is what I would like to do:

I have a java source code file:

I want to be able to compile it, and attempt to run it, ie: javac
followed by java Javatest

Do I use command prompt for this? Every time I try and compile the test code, It says the command is not found. And I've downloaded the developer kit from Sun Microsystems, and JRE as well (current versions). How can I get this to work? I know this is a really basic question but I hope someone on the forum can help me out!

Thanks so much! Always helpful!
Brown Belt
Brown Belt
Posts: 354
Joined: Sun Jun 13, 2004 3:36 pm
Location: Moscow, ID

Postby evasive » Fri Dec 17, 2010 12:08 am

We hate rut, but we fear change.
System error, strike any user to continue...
Mobo-fu Master
Mobo-fu Master
Posts: 37461
Joined: Sun May 06, 2001 12:01 am
Location: Netherlands

Postby Roach412 » Fri Dec 17, 2010 2:28 pm

you would need to make sure that you have your PATH set, it sounds like you're trying to run JAVA commands where they don't reside.

check out this rundown: ... ingup.html

If you don't set the PATH variable, you need to specify the full path to the executable every time you run it

Lian Li Lancool First Knight Series PC-K59W
Intel Core i7-960 Bloomfield 3.2GHz
EVGA X58 FTW3 132-GT-E768-TR
G.SKILL Ripjaws Series 12GB (3 x 4GB)
Crucial M4 128gb SATAIII SSD x2
Crucial M4 256gb SATAIII SSD
OCZ Saber 1000 960GB Enterprise SSD
Corsair Professional Series HX850 PSU
Dell UltraSharp U2713HM 27" w/drop ceiling mount
Logitech G930 7.1 Headset
Logitech G402 Hyperion Fury
Black Belt 2nd Degree
Black Belt 2nd Degree
Posts: 2739
Joined: Mon Aug 09, 2004 7:33 pm
Location: Milwaukee - Wisconsin

Postby Empyre » Fri Dec 17, 2010 11:34 pm

Thank you for all of the help! I actually figured it out earlier today after checking out the links that evasive posted that I need to set the PATH correctly to the JDK folder. After that it worked like a charm. Again to the rescue, thank you evasive and Roach. I greatly appreciate your help.
Brown Belt
Brown Belt
Posts: 354
Joined: Sun Jun 13, 2004 3:36 pm
Location: Moscow, ID

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests