1

When I run the Jar-file inside netbeans it works. But after I clean and build it, it won't run. It gives me an error, that the Mainclass couldn't be found.

I tried already something like:

java -cp C:\javaProjectsTests\J.jar;C:\javaProjectsTests\lib\*;. j.J

java -Djava.library.path=C:\javaProjectsTests\lib\* -jar C:\javaProjectsTests\J.jar

Maybe someone could help?

ekad
  • 14,436
  • 26
  • 44
  • 46
loadP
  • 404
  • 1
  • 4
  • 15

2 Answers2

3

Please refer below link Execute jar file with multiple classpath libraries from command prompt

Lod your jars to classpath and execute your class (with main method)

Community
  • 1
  • 1
kani
  • 61
  • 7
0

Thanks,

It was a syntaxerror in the path-string.

It works now, but only if the lib-folder(other jar-files) is in the same directory as the executing jar-file. Should not a problem for comandline programs, as it's possible to use a batch-file to execute from somewhere else.

However I asked me if it's possible to merge archives, as I could read on a website here ?

loadP
  • 404
  • 1
  • 4
  • 15