I am trying to create an instance of a java .class file (Byte code of a java code). But when i do so i get an error as follows :-
Exception in thread "main" java.lang.NoClassDefFoundError: SamplePro
at com.sample.testenvironment.Test.getTest(Test.java:29)
at com.sample.testenvironment.Test.main(Test.java:42)
Caused by: java.lang.ClassNotFoundException: SamplePro
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 2 more
I am trying to create an instance of SamplePro. And I have attached the .class file of SamplePro to the class library of the project in which I am trying to create its instance.