简体   繁体   中英

How to convert a web application having no main class from jar to exe using launch4j?

I developed a web application using jsp, servlets, oracle database and javascript in eclipse. Now, I am trying to convert its JAR to EXE file using launch4j. Since my application has no main class, while executing EXE it is giving error "no main manifest attribute". What should i do? Help me!

I assume your web application is the standard 'war' format, with a WEB-INF and everything. It can have a web.xml, but not necessary.

You need to write an embedded launcher. Jetty is great for this. You might even be able to use their start.jar, but writing your own embedded launcher is pretty easy.

https://www.eclipse.org/jetty/documentation/9.3.x/embedding-jetty.html

You write a 'main' function in a launcher class, and set that as your entry point in a runnable jar. You can do this from eclipse using "Export... / Java / Runnable Jar"

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