LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 564 users online 186377 members 927 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Video | Dictionary | News | FAQ
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
6 online / 23 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Help with compiling a Java file?
Replies: 5Last Post Sep. 7 12:52pm by matto
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( Majo )


Soothsayer
Reply
I'm just starting my Programming for Info Tech I class and am already stuck. I did about half of my assignment in class, saved it to my flash drive, made sure it was on there, and then went back to my room.

I'm trying to work on it now but, well...it's empty... I open it and there's like...no coding in there...

So I started a new one and now I can't get it to compile. I can get it to compile in jGRASP but not in a DOS window which is what I'm supposed to do. Wha?...

*clearly a newbie*

-------
"Under the hardness of her facade a woman's heart is still beating."


4:24 pm on Sep. 6, 2008 | Joined May 2005 | 271 Days Active
Join to learn more about Majo Pennsylvania, United States | Straight Female | 6383 Posts | 11062 Points
HideOrSeek


Professional
Reply
Gaaahh,
Under what extension did you save it?

-------
Mi-Re-Do-Re-Mi-Fa-Mi.

4:26 pm on Sep. 6, 2008 | Joined Mar. 2008 | 69 Days Active
Join to learn more about HideOrSeek Venezuela | Label Free Male | 1384 Posts | 2168 Points
( Majo )


Soothsayer
Reply
.java

-------
"Under the hardness of her facade a woman's heart is still beating."

4:37 pm on Sep. 6, 2008 | Joined May 2005 | 271 Days Active
Join to learn more about Majo Pennsylvania, United States | Straight Female | 6383 Posts | 11062 Points
matto


Visionary

Patron
Tech Support Leader
Reply
Quote: from Majo at 4:24 pm on Sep. 6, 2008

So I started a new one and now I can't get it to compile. I can get it to compile in jGRASP but not in a DOS window which is what I'm supposed to do. Wha?...

*clearly a newbie*


You need to tell us more.  What did you type?  What error was given?  What is the source code?  etc

-------
"Don't bail; the best of the gold is at the bottom of the barrels of crap."
-- Randy Pausch

12:49 am on Sep. 7, 2008 | Joined Aug. 2007 | 274 Days Active
Join to learn more about matto California, United States | Straight Male | 4825 Posts | 9356 Points
( Majo )


Soothsayer
Reply
I believe all I typed was:

Code:
public class ILoveJava
{
}


To compile it, I just typed:

Code:
javac ILoveJava.java


The error I was given was something to the extent of javac not being recognized as an internal or external command.


-------
"Under the hardness of her facade a woman's heart is still beating."


9:12 am on Sep. 7, 2008 | Joined May 2005 | 271 Days Active
Join to learn more about Majo Pennsylvania, United States | Straight Female | 6383 Posts | 11062 Points
matto


Visionary

Patron
Tech Support Leader
Reply
This is almost definitely caused by not having your java bin in your path.

Assuming windows because of the error you gave...
Go to wherever you installed java.  The default is C:\Program Files\Java\jdk1.6.0_07 if you're using the updated version at the time of this posting.  Make sure that this directory has a bin subdirectory, and that that bin subdirectory has java, javac, and all those other exe/bat files in there.

THEN add that bin directory to your PATH environment variable.
Start > Right click "My Computer" > Properties > Advanced Tab > Environment Variables > find PATH in the lower section and press Edit, and append C:\Program Files\Java\jdk1.6.0_07\bin to the end of that string (adjust as necessary).

NOW, open up cmd and if you type "echo %PATH%" the java bin should show up, and when you type java or javac it will be recognized as a command

-------
"Don't bail; the best of the gold is at the bottom of the barrels of crap."
-- Randy Pausch


12:52 pm on Sep. 7, 2008 | Joined Aug. 2007 | 274 Days Active
Join to learn more about matto California, United States | Straight Male | 4825 Posts | 9356 Points
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic