Results 1 to 3 of 3
Thread: Can't get any program to run
- 10-05-2009, 12:40 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 4
- Rep Power
- 0
Can't get any program to run
Hey all.
I've only started learning java today and i'm having trouble getting programs to run - even hello world! :)
The contents of hello.java are:
public class hello {
public static void main (String[] args) {
System.out.println("Hello, world");
}
}
When I type
"java hello.java" I get
h t t p : / / img12.imageshack.us/img12/4046/javaerror.png
I'm sorry for breaking the rules so early on - I did try to pipe the output to a file so I could copy & paste it but it wasn't working - sorry!
I kno that i'm only new, but i'm not convinced its my code; I get the exact same message if I point it to a file that doesn't exist - the only difference being the file name.
I'm writing in notepad then using java via the command prompt to run my program. I've installed jdk 6 update 16 and java db 10.4.2.1 along with java 6 update 16.
If anyone could help me out at all with this issue i'd be very greatfull.
Thanks for reading.
- 10-05-2009, 01:25 AM #2
Member
- Join Date
- Oct 2009
- Posts
- 10
- Rep Power
- 0
I'm pretty new to this as well but I think you need to compile it first:
javac hello.java
and then run the class file
java hello
- 10-05-2009, 02:08 AM #3
Member
- Join Date
- Oct 2009
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Execute A program from a Program!
By Moncleared in forum Advanced JavaReplies: 2Last Post: 02-22-2009, 04:17 PM -
Executing a program within a program
By gibsonrocker800 in forum New To JavaReplies: 5Last Post: 05-12-2008, 08:24 AM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks