Closed Thread
Results 1 to 9 of 9

Thread: Java Help - Compiles Fine, But Error on Running?

  1. #1
    UnknownFear's Avatar
    UnknownFear is offline Learning Programmer
    Join Date
    Oct 2009
    Location
    Toronto, Ontario
    Posts
    47
    Blog Entries
    1
    Rep Power
    0

    Question Java Help - Compiles Fine, But Error on Running?

    Hello all. Haven't posted much in this forum for awhile, but I don't think I'll ever leave this place as it is my main focus on a career To my problem; I have a jailbroken iPhone and I installed Java onto it so I can write programs on the run, which by the way is pretty awesome Now, I have tried my best to write a simple input program using BufferedReader as Scanner was not implemented into this compiler. If it helps. I am using the Jikes compiler. Now, when I go to compile it, it compiles perfectly but, not when I go to run it, it gives me these weird errors.

    This is my Java code for the program I am trying to write:

    Code:
    // Input
    // Input information and display to screen
    // @Daniel Millier
    
    import java.util.*;
    import java.io.*;
    import java.lang.*;
    
    class Input{
              public static void main(String args[]) throws IOException{
              BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
    
              String name;
    
              System.out.print("What is your name?");
              name = read.readLine();
              System.out.println("Hello, " + name);
              read.close();
              }
    }
    Does this look right?

    I really hope you guys can help me out. Thanks for your time
    Attached Thumbnails Attached Thumbnails Java Help - Compiles Fine, But Error on Running?-.jpg  

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    UnknownFear's Avatar
    UnknownFear is offline Learning Programmer
    Join Date
    Oct 2009
    Location
    Toronto, Ontario
    Posts
    47
    Blog Entries
    1
    Rep Power
    0

    Re: Java Help - Compiles Fine, But Error on Running?

    EDIT: I have found the error. I had the class name "HelloWorld" and I compiled it with the name "Input". My mistake

  4. #3
    GMVResources's Avatar
    GMVResources is offline Learning Programmer
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    0

    Re: Java Help - Compiles Fine, But Error on Running?

    Lol, and also I recommend you to use Eclipse or Netbeans, Netbeans (which I use) is a compiler and interpreter so it is very useful.

  5. #4
    UnknownFear's Avatar
    UnknownFear is offline Learning Programmer
    Join Date
    Oct 2009
    Location
    Toronto, Ontario
    Posts
    47
    Blog Entries
    1
    Rep Power
    0

    Re: Java Help - Compiles Fine, But Error on Running?

    Quote Originally Posted by GMVResources View Post
    Lol, and also I recommend you to use Eclipse or Netbeans, Netbeans (which I use) is a compiler and interpreter so it is very useful.
    I use Eclipse and it's pretty good

  6. #5
    GMVResources's Avatar
    GMVResources is offline Learning Programmer
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    0

    Re: Java Help - Compiles Fine, But Error on Running?

    What is it that is so good with Eclipse because I use NetBeans and I'm curious =D

  7. #6
    UnknownFear's Avatar
    UnknownFear is offline Learning Programmer
    Join Date
    Oct 2009
    Location
    Toronto, Ontario
    Posts
    47
    Blog Entries
    1
    Rep Power
    0

    Re: Java Help - Compiles Fine, But Error on Running?

    Quote Originally Posted by GMVResources View Post
    What is it that is so good with Eclipse because I use NetBeans and I'm curious =D
    I have no idea, I just like it.

  8. #7
    GMVResources's Avatar
    GMVResources is offline Learning Programmer
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    0

    Re: Java Help - Compiles Fine, But Error on Running?

    Unknown, but I want to know what is so good about it to see if I should get it too

  9. #8
    Join Date
    Jun 2010
    Location
    Vancouver, Eh.
    Posts
    4,020
    Blog Entries
    7
    Rep Power
    39

    Re: Java Help - Compiles Fine, But Error on Running?

    Quote Originally Posted by GMVResources View Post
    Unknown, but I want to know what is so good about it to see if I should get it too
    IBM wrote a nice article on the exact subject, actually. It lists the differences and basics of Eclipse over Netbeans:
    [Link: Migrating to Eclipse: A developer's guide to evaluating Eclipse vs. Netbeans ]

  10. #9
    GMVResources's Avatar
    GMVResources is offline Learning Programmer
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    0

    Re: Java Help - Compiles Fine, But Error on Running?

    Thanks Nullw0rm!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mt.exe and error running my programs
    By reaper in forum Computer Software/OS
    Replies: 3
    Last Post: 09-05-2010, 07:53 PM
  2. I can't fine the error in this.
    By so1i in forum JavaScript and CSS
    Replies: 2
    Last Post: 11-23-2009, 07:15 AM
  3. [Help] Compiles but doesn't run.
    By Shockwave in forum C and C++
    Replies: 13
    Last Post: 10-28-2009, 01:16 PM
  4. Windows Error while running the program
    By jwxie518 in forum C and C++
    Replies: 3
    Last Post: 03-11-2009, 12:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts