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 13 of 13

Thread: What is wrong?

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default What is wrong?

    So I made this, it will be the class with the grahpics of my game. I don't know what I did wrong here? It is a red circle with a white X in beside of the public final int texts.
    package com.mime.lifeless.graphics;
     
    public class Render {
    	public final int width;
    	public final int height;
    	public final int[] pixels;
     
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: What is wrong?

    I don't know what I did wrong here?
    Please explain why you think something is wrong.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    May 2014
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: What is wrong?

    Quote Originally Posted by Norm View Post
    Please explain why you think something is wrong.
    Because there is red circle with a white X in it beside all the public final int codes.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: What is wrong?

    Can you get the compiler to give you some error messages that say what is wrong?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    May 2014
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: What is wrong?

    Quote Originally Posted by Norm View Post
    Can you get the compiler to give you some error messages that say what is wrong?
    When I compile it doesn't says any error messages but when I compile it says "Errors exist in required project(s): Proceed with launch?"

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: What is wrong?

    You need to learn how to use the tools you are using. Somewhere it shows you what the error is.

    To get error messages that can be copied here, use the javac.exe compiler program. It writes the error messages to the console where they can be copied.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    May 2014
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: What is wrong?

    Quote Originally Posted by Norm View Post
    You need to learn how to use the tools you are using. Somewhere it shows you what the error is.

    To get error messages that can be copied here, use the javac.exe compiler program. It writes the error messages to the console where they can be copied.
    How? I compile it, it starts, in the console there is no errors. How do I open the compiler program? ( Gyazo - 84a3bc5d85d5385607c922dc274cbc74.gif )

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: What is wrong?

    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    May 2014
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: What is wrong?

    Quote Originally Posted by Norm View Post
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    Running...

    That is all that shows up.

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: What is wrong?

    That doesn't show any errors.
    If you want to see a message when the code is executed, add a call to the println method that prints out a message.
    If you don't understand my answer, don't ignore it, ask a question.

  11. #11
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: What is wrong?

    In Eclipse look at the bottom pane where Console is located. There is a Problems tab. Click on the tab, and you should see the errors indicated by the x-in-red-circle (error) icons. You can copy-and-paste the error message here.

    Another way to get to the error message is to mouse over the error icon or the variable with the squiggly line. A tooltip will appear containing the error message. You can then move the mouse pointer onto the tooltip and click on it, after which you'll be able to copy the error message.

    The problem you're facing is due to the use of the final keyword. See final (Java) - Wikipedia, the free encyclopedia to better understand this.

  12. #12
    Junior Member
    Join Date
    May 2014
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: What is wrong?

    Quote Originally Posted by jashburn View Post
    In Eclipse look at the bottom pane where Console is located. There is a Problems tab. Click on the tab, and you should see the errors indicated by the x-in-red-circle (error) icons. You can copy-and-paste the error message here.

    Another way to get to the error message is to mouse over the error icon or the variable with the squiggly line. A tooltip will appear containing the error message. You can then move the mouse pointer onto the tooltip and click on it, after which you'll be able to copy the error message.

    The problem you're facing is due to the use of the final keyword. See final (Java) - Wikipedia, the free encyclopedia to better understand this.
    The three errors is "Description Resource Path Location Type
    The blank final field height may not have been initialized Render.java /Lifeless/src/com/mime/lifeless/graphics line 5 Java Problem
    "Description Resource Path Location Type"
    The blank final field pixels may not have been initialized Render.java /Lifeless/src/com/mime/lifeless/graphics line 6 Java Problem
    "Description Resource Path Location Type"
    The blank final field width may not have been initialized Render.java /Lifeless/src/com/mime/lifeless/graphics line 4 Java Problem
    "

    That is all the errors.

  13. #13
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: What is wrong?

    The blank final field pixels may not have been initialized
    Assign all of them a value when defining them.
    Making them final means that their value can NOT be changed afterwards.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 4
    Last Post: March 6th, 2014, 05:14 PM
  2. What did I do wrong here?
    By Paetilium in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 19th, 2012, 11:13 PM
  3. [SOLVED] where I'm wrong?
    By arvindbis in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 7th, 2012, 09:12 AM
  4. WHAT IS WRONG HERE PLEASE?
    By mjava in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 27th, 2010, 08:29 PM
  5. What's wrong?!
    By deeerek in forum What's Wrong With My Code?
    Replies: 6
    Last Post: February 22nd, 2010, 07:11 PM