Ho la seguente gerarchia di directory:Creare file jar da linea di comando
SigarTest
src
SigarTest
.java files
bin
SigarTest
.class files
Qui, SigarTest è un nome di pacchetto. La cartella principale si trova nella cartella bin di jdk. Da lì, im eseguendo il seguente comando per creare un file jar del mio progetto -
./jar cfe temp.jar SigarTest.SigarMain SigarTest/bin/ tools.jar sigar.jar mongo-2.7.3.jar
dove sono richieste tools.jar, Mongo-2.7.3.jar e sigar.jar e si trovano nella stessa cartella directory root (cartella bin di jdk). Tuttavia, eseguendolo, ottengo
ClassNotFoundException : SigarTest.SigarMain
Cosa sto facendo di sbagliato?
jar cfe temp.jar SigarTest.SigarMain.class SigarTest/bin .... prova il suo –
@AlpeshPrajapati: Non è lo stesso di quello che ho fatto? – Cygnus
non hai aggiunto .class dopo SigarTest.SigarMain ... –