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: Where is my class??

  1. #1
    Junior Member zlloyd1's Avatar
    Join Date
    Nov 2012
    Location
    Norfolk, Virginia
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Where is my class??

    I have created a simple program to create a graphical user interface GUI window that contains the text Hello World in it, and in NetBeans it compiles and runs fine. Unfortunately, it does not run in the command prompt, although it does compile fine.
    Here is my code:
    //*Zachariah A Lloyd
     //* HELLO WORLD Interface*/
    package guihelloworld;
    import javax.swing.JOptionPane;
    public class GUIHelloWorld {
        public static void main(String[] args){
            JOptionPane.showMessageDialog(null, "HELLO WORLD");}}
    and as I said when I run this in NetBeans there are no errors or problems at all.
    Attachment 1613Attachment 1614
    However, when I try to run it in the command prompt, it won't work right, complaining about having some problem locating the main class??
    Attachment 1615
    I KNOW my code is correct, but it just WON'T RUN????
    Can someone please tell me what this is all about?? Thanks in advance!!


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,360
    My Mood
    Hungover
    Thanks
    144
    Thanked 626 Times in 537 Posts

    Default Re: Where is my class??

    Please copy and paste the exact text of the command prompt, including how you're running the file and the error message you receive.
    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!

Similar Threads

  1. Java, calling another public class from within the main class giving problems.
    By RandomGaisha in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 26th, 2012, 01:30 PM
  2. Replies: 2
    Last Post: November 18th, 2012, 01:09 PM
  3. need to make basic class and implementation class (base class without void main)
    By javanewbie101 in forum Object Oriented Programming
    Replies: 1
    Last Post: September 19th, 2012, 08:03 PM
  4. create a test class (main method) to start(run) the class in Java
    By curious725 in forum Java Theory & Questions
    Replies: 5
    Last Post: August 1st, 2012, 03:21 AM
  5. Replies: 3
    Last Post: June 17th, 2012, 06:22 PM

Tags for this Thread