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: Javatest.java

I want to be able to compile it, and attempt to run it, ie: javac Javatest.java
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 mobo.org! Always helpful!
Empyre
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...
evasive
Mobo-fu Master
Mobo-fu Master
 
Posts: 36856
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:
http://www.apl.jhu.edu/~hall/java/begin ... 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


-Roach
Lian Li Lancool First Knight Series PC-K59W
Intel Core i7-960 Bloomfield 3.2GHz
EVGA X58 FTW3 132-GT-E768-TR
EVGA GTX 660ti
G.SKILL Ripjaws Series 12GB (3 x 4GB)
Crucial M4 128gb SATAIII SSD x2
Corsair Professional Series HX850 PSU
Roach412
Black Belt 2nd Degree
Black Belt 2nd Degree
 
Posts: 2569
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 Mobo.org to the rescue, thank you evasive and Roach. I greatly appreciate your help.
Empyre
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 0 guests