| | |
Problems launching java source code (serious newbie, sorry! :( )
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2004
Posts: 2
Reputation:
Solved Threads: 0
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
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
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
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
•
•
•
•
In a world without walls or fences,
What use are Windows and Gates.
![]() |
Similar Threads
Other Threads in the Java Forum
- Previous Thread: Java GUI--Dynamically Adding Buttons to a Menu
- Next Thread: Interacting With The Microphone
Views: 2556 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code color compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool keyword linux list loop map method methods mobile netbeans newbie number object oracle pong print problem producer program programming project projectideas read recursion reflection rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows





