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

Thread: Using NetBeans and I have no idea what the error message means...

  1. #1
    Member
    Join Date
    Jan 2013
    Posts
    37
    My Mood
    Confused
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Using NetBeans and I have no idea what the error message means...

    Hi all. I am brand new to Java. I am taking the class at Phoenix and I am attempting to use the NetBeans IDE 7.2.1 tool to create my very first program.

    I did the same thing using Notepad and the command prompt, and it worked fine. The NetBean IDE tool is indicating an error that I have no clue how to fix.

    I was hoping you folks could steer me in the right direction.

    Here is the code from NetBeans:


    [code=Java]
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package phoenix;
    /**
    *
    * @author Me
    */
    public class Phoenix {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    System.out.println("Hello World!");
    }
    }
    [/code=Java]



    The error I get on line 10 says "class Phoenix is public, should be declared in a file named Phoenix.java"

    I have no idea what this means or how to fix it. Any help you can offer would be greatly appreciated!!

    Rick


  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: Using NetBeans and I have no idea what the error message means...

    in a file named Phoenix.java"
    That is the important part of the message. The file containing the public Phoenix class needs to be in a file named Phoenix.java.

    No idea how to tell your IDE what to do. A simple solution could be to rename the class so it has the same name as the file it is in.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] Help making an error message.
    By Lost_Secret in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 1st, 2011, 04:48 PM
  2. Strange error message
    By javapenguin in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 11th, 2011, 02:03 PM
  3. an error message while runnung java
    By sravan_kumar343 in forum Java Theory & Questions
    Replies: 1
    Last Post: January 25th, 2010, 10:19 AM
  4. help with a error message
    By JavaNoob82 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 23rd, 2010, 02:56 PM
  5. help with problem havr no idea what it means
    By mdstrauss in forum Exceptions
    Replies: 4
    Last Post: July 27th, 2009, 12:41 AM