Results 1 to 8 of 8

Thread: Those experienced in Java: What am I doing wrong?

  1. #1
    Member Edward's Avatar
    Join Date
    Oct 2009
    Location
    Your default internet browser
    WCA Profile
    2011KING01
    YouTube
    twistnturn44
    Posts
    2,505

    Lightbulb Those experienced in Java: What am I doing wrong?

    Okay, so I'm trying to learn Java here, and I think I'm making this Hello World program correctly. But there's a problem. When I try to compile it, it gives me
    1 error found:
    File: (no associated file) [line: (no source location)]
    Error: java.lang.NullPointerException
    screenshotfrom201206182.png

    Code:
    public class HelloWorld
    {
     public static void main(String[] args)
     {
       System.out.println("Hello World");
     }
    }
    That's my code. What did I do wrong? Everything seems to be in order. Is it a problem with my IDE?
    Thanks in advance.

  2. #2
    Member tasguitar7's Avatar
    Join Date
    Nov 2011
    Location
    Wichita, Kansas
    Posts
    110

    Default

    Your code is correct so there must be a problem with the way you are compiling it. Are you using an IDE or just the JDK?
    [single][full-step][avg5][avg12][avg100]: [10.53][12.46][18.86][19.84][21.47]

  3. #3
    Member Edward's Avatar
    Join Date
    Oct 2009
    Location
    Your default internet browser
    WCA Profile
    2011KING01
    YouTube
    twistnturn44
    Posts
    2,505

    Default

    Quote Originally Posted by tasguitar7 View Post
    Your code is correct so there must be a problem with the way you are compiling it. Are you using an IDE or just the JDK?
    Oh this is a bit embarrassing. Thanks for telling me my code was correct. It led me to get a new IDE (using Geany now) and that had everything running crispy and clean.

    I guess this thread is done, son.

  4. #4
    Premium Member Bryan's Avatar
    Join Date
    Oct 2007
    Location
    Rochester, MN
    WCA Profile
    2007LOGA01
    Posts
    1,296

    Default

    Quote Originally Posted by Edward View Post
    It led me to get a new IDE (using Geany now) and that had everything running crispy and clean.
    Were you using Eclipse before?
    CubingUSA.com - Find other cubers, be notified of upcoming competitions, and more.

  5. #5

    Default

    I believe that the principal problem is that you are using the Java programming language.

    The solution is to avoid using the Java programming language in favor of another programming language like:

    1. Motorola 68000 assembly
    2. Fortran 90 (or 95)
    3. Standard ML

    I hope this helps.
    Last edited by Quadrescence; 06-22-2012 at 01:40 PM.

  6. #6
    Member
    Join Date
    May 2012
    Location
    Pullman, WA
    Posts
    295

    Default

    If I had to name my five most favorite programming languages, Java, 68000 assembly and earlier versions of Fortran would be included. The 68000 has a clean machine code, the only thing better is the assembler for the DecSystem-20. The 90 Fortran version already has absorbed too much Pascal crap.

  7. #7

    Default

    use Eclipse
    If anyone wants to add me on Guild Wars 2 send me a PM :tu

  8. #8
    Member Edward's Avatar
    Join Date
    Oct 2009
    Location
    Your default internet browser
    WCA Profile
    2011KING01
    YouTube
    twistnturn44
    Posts
    2,505

    Default

    Quote Originally Posted by aronpm View Post
    use Eclipse
    Quote Originally Posted by Bryan View Post
    Were you using Eclipse before?
    Before I was using some crappy program, I think it was called Dr. Java(?)
    Eclipse won't work on my system for some reason (old ass computer with Linux mint) and I can't be bothered to make it work. Geany seems just fine. Is it not? :O
    Last edited by Edward; 06-27-2012 at 07:51 AM.

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
  •