Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: today is 1st day with java and i am screwed...

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default today is 1st day with java and i am screwed...

    hi.. I am Sumit from Kolkata
    I am a student...
    today is my 1st day with java and i am trying to run a simple programm in karel world..
    my code is

    import stanford.karel.*;
     
    public class CheckerboardKarel extends SuperKarel {
     
    	// You fill in this part
    	public void run() {
    		move ();
    		pickBeeper ();
    		move();
    		turnLeft();
     
    	}
    }

    but when i click the run button the error poped in console tab is

    Exception in thread "main" java.lang.NullPointerException
    at acm.program.Program.main(Program.java:917)
    at stanford.karel.Karel.main(Karel.java:202)



    i tried a lot to figured it out but i can't did..
    i am using "eclipse" software..

    untitled.JPG

    screenshot of my monitor is attached...

    someone help me please...
    Last edited by JavaPF; December 20th, 2011 at 07:43 AM. Reason: Please use highlight tags


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,331
    Thanks
    49
    Thanked 2,194 Times in 2,167 Posts

    Default Re: today is 1st day with java and i am screwed...

    thread "main" java.lang.NullPointerException
    at acm.program.Program.main(Program.java:917)
    at stanford.karel.Karel.main(Karel.java:202)
    The error message says there is a variable with a null value in your code.

    Did you post the full contents of the stack trace? This does not look like all of it.
    There should be a line in the trace with the name of your program and a method in your code.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,331
    My Mood
    Hungover
    Thanks
    143
    Thanked 624 Times in 535 Posts

    Default Re: today is 1st day with java and i am screwed...

    I'm going to move this thread to a more appropriate forum. Please read this: This Forum is for Saying Hi, not for Asking Technical Questions (READ BEFORE POSTING). You might also want to use a more informative title.

    Also, you really haven't given us enough information to go on. Look at line number 917 in Program.java. Something is null there. Use print statements to figure out what it is. If you still have questions, post an SSCCE (only a few lines, certainly not 917 lines) demonstrating the problem.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,331
    My Mood
    Hungover
    Thanks
    143
    Thanked 624 Times in 535 Posts

    Default Re: today is 1st day with java and i am screwed...

    Ugh, please don't post multiple copies of the same question. I've merged your duplicate posts.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Junior Member
    Join Date
    Dec 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: today is 1st day with java and i am screwed...

    thanks Kevin!
    can you please tell me how to create new Karel world in eclipse..

  6. #6
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,331
    My Mood
    Hungover
    Thanks
    143
    Thanked 624 Times in 535 Posts

    Default Re: today is 1st day with java and i am screwed...

    Quote Originally Posted by sumit043020701 View Post
    thanks Kevin!
    can you please tell me how to create new Karel world in eclipse..
    What? How would we know that? I have no idea what a "Karel world" is, and you haven't provided what you've been asked to provide. Please see the link in my signature on asking questions the smart way. If you ask a more specific question, we'll be happy to help you.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    Junior Member
    Join Date
    Dec 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: today is 1st day with java and i am screwed...

    Well..!! perhaps you could not understand that what i asked. I also could not understand that why there types of error is poping. But finally i got my solution. it is not exactly solution... well when i run the same code in windows xp i got my desired output without ant freeking error.

    Thanks for reading my post..!! Hope after some day i've a more specific question that come you on work..

Similar Threads

  1. Make money today as a Java freelancer
    By JavaPF in forum Paid Java Projects
    Replies: 15
    Last Post: June 12th, 2014, 03:41 AM
  2. NEED HELP NOW, DUE TODAY
    By klagartin in forum What's Wrong With My Code?
    Replies: 5
    Last Post: March 21st, 2011, 06:04 PM
  3. Screwed up system variables
    By paisa90 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 19th, 2010, 11:56 PM
  4. Rounding screwed up?
    By The_Mexican in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 6th, 2010, 12:43 PM
  5. [SOLVED] Help me with different activities in Java program
    By xyldon27 in forum Java Theory & Questions
    Replies: 10
    Last Post: June 9th, 2009, 09:42 AM