Problems launching java source code (serious newbie, sorry! :( )

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2004
Posts: 2
Reputation: heaney37 is an unknown quantity at this point 
Solved Threads: 0
heaney37 heaney37 is offline Offline
Newbie Poster

Problems launching java source code (serious newbie, sorry! :( )

 
0
  #1
Sep 14th, 2004
HI there,

sorry, this is an incredibly basic problem, its just confusing me no end - no previous programming experience and trying to get my head round java - i have followed some guides for the source code and have came up with the following to display 'welcome to java!' in the command prompt.

-----------------------
// Welcome.java: This application program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}

----------------------

The problem i now have is after installing JDK 1.4 on my machine, the 'javac' command (to compile the source code??) does not seem to be working, i.e. 'c:\Documents and Settings\Paul>javac Welcome.java' is unrecognised.


I know the commands or file organisation are wrong, but im really not sure how or why

Any help would be greatly greatly appriciated!

cheers,


paul
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 153
Reputation: cosi is an unknown quantity at this point 
Solved Threads: 1
cosi's Avatar
cosi cosi is offline Offline
Junior Poster

Re: Problems launching java source code (serious newbie, sorry! :( )

 
0
  #2
Sep 15th, 2004
oops... I accidentally hit submit. see my next post
In a world without walls or fences,
What use are Windows and Gates.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 153
Reputation: cosi is an unknown quantity at this point 
Solved Threads: 1
cosi's Avatar
cosi cosi is offline Offline
Junior Poster

Re: Problems launching java source code (serious newbie, sorry! :( )

 
0
  #3
Sep 15th, 2004
Hi Paul,

The problem is that javac is not in your path. To add it to your path, first find where javac is. For me this is in C:\Program Files\j2sdk_nb\j2sdk1.4.2\bin. Yours may be different. (See picture 1 _javac.JPG).

Then, you should go to your Control Panel, and goto Performance and Maintenance if you have it, then open System. (see control panel.JPG) Under System you should see Environment variables. (see environment variables.JPG) Click there. You should then see something like my 3nd attached screenshot "environment variables2.JPG". Goto Path and hit edit. Add to the end of your path this "; C:\{PATH_TO_YOUR_JAVA}\bin\

Hope this helps!


Ed
Attached Thumbnails
_javac.JPG   environment variables.JPG   environment variables2.JPG   control panel.JPG  

In a world without walls or fences,
What use are Windows and Gates.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 2
Reputation: heaney37 is an unknown quantity at this point 
Solved Threads: 0
heaney37 heaney37 is offline Offline
Newbie Poster

Re: Problems launching java source code (serious newbie, sorry! :( )

 
0
  #4
Sep 15th, 2004
Thank you very much!

I've managed to create a few cool little dialog box programs now!

many many thanks!!!
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1
Reputation: kirrz is an unknown quantity at this point 
Solved Threads: 0
kirrz kirrz is offline Offline
Newbie Poster

Thank You!

 
0
  #5
Jun 16th, 2005
THANK YOU! I was trying to figure it out for ages too!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2556 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC