Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (13.1k points)

Can anyone help with the exception java.long.NoClassDefFound? Whenever I run the program at the runtime it is throwing an error. Herewith I have attached my Main.Java:

import graphics.shapes.*;

import graphics.linepoint.*

import graphics.spaceobjects.*;

public class Main {

    public static void main(String args[]) {

        Square s = new Square(2,3,15);

        Line l = new Line(1,5,2,3);

        Cube c = new Cube(13,32,22);

    }

}

1 Answer

0 votes
by (26.7k points)

Basically, you need to import a graphics package into it. Try adding your Main class into the graphics package. It will work.

I hope this will help.

Want to become a Java Expert? Join Java Certification now!!

Want to know more about Java? Watch this video on Java Tutorial for Beginners | Java Tutorial :

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...