First of all thank you for reading my question. I have a .jar file and .java file which I should compile
They are "fractals.jar" and "FractalsTest.java"
So basically "fractals.jar" contains .class files with packages to run a simple program that displays fractals on a java program, and the directory looks like this.
fractals -- FractalExplorer
| FracalGenerator
| JImageDisplay
+ generator -- Mandelbrot
-- BurningShip
-- Tricorn
So, The top three classes are under directory(folder) and package called "fractals" the the three fractal patterns under directory(folder_ and package named "fractals.generator" FractalGenerator utilizes the three fractal pattern classes by importing them, and FractalExplorer class is the class that contains the main function. I have succeeded in compiling the six classes and compressed them as "fractals.jar" file with manifest including "Main-Class: fractals.FractalExplorer". Eventually, the "fractals.jar" file runs perfectly fine. But my goal here is to make another java file that utilizes the "fractals.jar" file like a library to run the same thing!!! So here is the code of "FractalsTest.java"
import fractals.*;
public class FractalsTest
{
public static void main(String[] args)
{
FractalExplorer fracExp = new FractalExplorer(800);
fracExp.createAndShowGUI();
fracExp.drawFractal();
}
}
I tried compiling it by entering on the cmd like this:
>javac -classpath fractals.jar FractalsTest.java
(assuming they both are on desktop)
It compiles perfectly fine, and "FractalsTest.class" is created.
And now all I need to do is entering
java -classpath fractals.jar FractalsTest
BUT!!!! The console screen shows that
"Could not find or load main class FractalsTest"
with "java.lang.ClassNotFoundException: FractalsTest"
Please help!!!What mistakes have I done?????