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

Thread: Java error

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

    Exclamation Java error

    I have compile and run the program it give


    C:\Users\JSK>cd Desktop

    C:\Users\JSK\Desktop>javac ColorScroll.java

    C:\Users\JSK\Desktop>java ColorScroll
    Error: Could not find or load main class ColorScroll

    this error


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

    Default Re: Java error

    Where is your SSCCE? It's pretty hard to debug if we can't see any code.
    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!

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,165
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java error

    Is there a class file?

    An example of error message when there is not a class file:
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    D:\JavaDevelopment\Testing\ForumQuestions9>java NoClassFile
    Error: Could not find or load main class NoClassFile

    D:\JavaDevelopment\Testing\ForumQuestions9>
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Junior Member JavaMistress's Avatar
    Join Date
    Apr 2014
    Location
    The Milky Way :3
    Posts
    9
    My Mood
    Stressed
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Java error

    Why ">" ? And do you have the txt-file saved on your desktop or in a folder?

    YOu may also have forgotten to make the mainclass the mainclass...

    that was my mistake at first.

    Did you use the public static void main(String[] args) {} method somewhere?

    PS: I agree with KevinWorkman... Iīd like to see some code.
    One day I got the chance to speak to a hacker.. of course, I asked him to tell me where to start. i asked him what to do and even requested homework...

    He said: "Hehe, you have to work hard on your own little girl.. donīt change your dreams, change the world.."

    ... and thatīs what Iīm going to do. If he is somewhere out there and reads this someday, I thank him for encouraging me. His words have boosted my will to fight!

Similar Threads

  1. Replies: 2
    Last Post: March 23rd, 2014, 08:44 AM
  2. Replies: 1
    Last Post: January 17th, 2013, 07:04 AM
  3. Replies: 0
    Last Post: July 2nd, 2012, 09:11 PM
  4. Java Error cannot be applied to (java.lang.String), phone book entry program.
    By iceyferrara in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 23rd, 2011, 06:32 AM
  5. [SOLVED] Java run time error: 'java.lang.NullPointerException"
    By ChandanSharma in forum What's Wrong With My Code?
    Replies: 9
    Last Post: June 20th, 2011, 11:53 AM

Tags for this Thread