简体   繁体   中英

Executing a jar file using a .bat file

I need to execute a jar file using a .bat file. The problem occurs here:

"java -Djava.library.path=timer -classpath .;timer\timer.jar"

There is a folder called " timer " within the folder in which I execute the .bat file and which contains the timer.jar. The jar is executed but it isn't using the timer I wanted it to use, instead I get a debug message that it wasn't possible to load the library and the program used the standard timer. I tried to add the library to the classpath manually, but that didn't work either. What am I doing wrong?

the simplest way is to use a manifest file within the main jar to load all libraries. using ide like netbeans or eclips will help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM