LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 497 users online 224605 members 680 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Areola
Cool Things: Areolas.
Mood: Disappointed
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
5 online / 24 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Adding Reply

Adding Reply
Archived Topic: It will not be bumped to the top of the forum.
Topic Help with compiling a Java file?
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
Majo Posted at 4:24 pm on Sep. 6, 2008
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*

Replies
matto Posted at 12:52 pm on Sep. 7, 2008
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

Majo Posted at 9:12 am on Sep. 7, 2008
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.

matto Posted at 12:49 am on Sep. 7, 2008
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
Majo Posted at 4:37 pm on Sep. 6, 2008
.java
HideOrSeek Posted at 4:26 pm on Sep. 6, 2008
Gaaahh,
Under what extension did you save it?
All 5 previous replies displayed.