-
Error with jar file
I keep getting a "Can't find main class. Program will exit".
This is what I have:
Copy.java has been compiled to copy.class. Here is the source code:
Code:
import java.io.*;
public class Copy {
public static void main(String[] args) throws IOException {
File inputFile = new File("text.txt");
File outputFile = new File("outagain.txt");
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1)
out.write(c);
in.close();
out.close();
}
}
I wrote a custom manifest file that has these lines of code:
Manifest-version: 1.0
Main-Class: Copy
Created-By: 1.4.2_09 (Sun Microsystems Inc.)
I used windows command line to compile, using this:
jar cmf c:\Manifest.mf c:\Copy.jar C:\Copy.class
Please help!