I'm trying to run a jar file from command line on Windows using:
java -cp .;C:\java\empacotadoJars\Empac.jar;C:\java\empacotadoJars\ClienteEmpacotado.jar ClienteEmpacotado
It raises the exception:
Could not find or load main class ClienteEmpacotado
The classes are:
public class Empacotado{
public static void escrever(){
System.out.println("Chamndo metodo de classe Empacotado!");
}
}
public class ClienteEmpacotado{
public static void main(String args[]){
Empacotado.escrever();
}
}
Empacotado.class is inside Empac.jar and ClienteEmpacotado.class is inside ClienteEmpacotado.jar. I first zipped each one and then renamed to jar extension. Inside ClienteEmpacotado.jar I created META-INF folder with MANIFEST.MF file, which contains:
Manifest-Version: 1.0
Main-Class: ClienteEmpacotado
What might be wrong?