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

Thread: main class problem

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

    Default main class problem

    I compiled my word processor program and i got this:

    Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
     
    	at net.jakobaindreas.javawordprocessor.JavaWordProcessor.main(JavaWordProcessor.java:24)

    Well the problem is in the main class but the reason why i'm confused because whats something in my main class is the Nimbus look and feel"

    public static void main(String[] args) {
        	try {
        		//The L&F
        		UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
        	} catch (Throwable e) {
        		e.printStackTrace();
        	}
     
    }


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: main class problem

    Please review this article to see if it helps. If not, you might continue your own web searching for a solution, or come back with your results and updated question(s).

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

    Default Re: main class problem

    Can you post line 24 and the specifics about what kind of error happened there?
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: main class problem

    Quote Originally Posted by Norm View Post
    Can you post line 24 and the specifics about what kind of error happened there?
    the line 24 is the main class

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: main class problem

    One line does not a class make. Well, I suppose it's possible, but not in this case.

    Norm was asking you to identify exactly which line in your source code editor is line 24 so that the source of the problem, identified as line 24 by the error message, can be correctly related to the same line in your code.

    Also, you identify line 24 as the main class, but I'm wondering if you don't mean somewhere in the main() method, since there's no indication that there is a class named Main. Rather, the class in which the error occurs is identified as "JavaWordProcessor" at line 24 which occurs in the main() method. It's important to be precise in the use of terms chosen to discuss these details, because programmers are nothing if not precise and so that we communicate effectively.

Similar Threads

  1. Problem with calling objects from same-class methods in main
    By thekbon in forum Object Oriented Programming
    Replies: 12
    Last Post: December 18th, 2012, 01:10 AM
  2. Replies: 2
    Last Post: November 18th, 2012, 02:09 PM
  3. Replies: 5
    Last Post: October 18th, 2012, 01:43 PM
  4. Main method/ class problem. I can't run any script!
    By BokBok in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 28th, 2012, 05:14 PM
  5. Main Class Not Found Problem
    By shadow in forum Java Theory & Questions
    Replies: 3
    Last Post: September 29th, 2009, 09:42 AM

Tags for this Thread