I have a file in .war
format.
Is it possible to convert it to an .exe
or .jar
file?
相关问题
- Dependencies while implementing Mocking in Junit4
- How to download and run a .exe file c#
- Writing an EXE output to a batch file
- Unable to generate jar file for Hadoop
- Using task scheduler for running java jar (from ba
相关文章
- java.lang.NoClassDefFoundError: javax/servlet/http
- Can I release an app without the device?
- Default arguments in JAR-manifest
- Archive option greyed out in xcode 4.5.2
- Eclipse war export: optimize for a specific server
- TAR encode/decode library for iPhone (ideally coco
- intellij build jar artifact containing gradle depe
- Can't get Jenkins to start using Tomcat
.war files are intended to be run inside a web container. So what you might want to do it to put the .war file in one, and run the web container from the task scheduler. I've done something like this before (although not with a task scheduler) using Jetty. Jetty itself is a java program, so you just start it by running
java.exe -jar start.jar
in the Jetty directory.Both war and jar are ZIPs. Thus, they can be easily converted.
However, wars usually store webs, while jars contain desktop programs.
So, converting a war to a jar would not be useful because, as the war contained a web, the converted jar will also contain a web, so trying to run it (as a program) will cause an error.
If you're looking to convert a web (the war) into a desktop app, this is not the way.
Please, take a look at Prism.
First of all why you need to do such thing?
As stated on wiki :
A war file is you application which is ready to run on server. As you said you are using tomcat you just need to put the war file in webapps folder of tomcat. And start the tomcat server. Its done. Your project will successfully run. No need to build exe [of war] for this.
If you wanna give client a setup that will look like set up and setups all things to run your app then you can use a exe maker software (like installJammer)and make your exe such that it includes tomcat with your war in webapps. Make shortcut to startup file of tomcat. So now when user clicks on shortcut tomcat will start and with it your application will also start and user can access it on browser.
Yes, you can covert a war into a jar file by just changing the suffix.
Both wars and jars have the same basic format (they're ZIP files), but wars usually have dependent jars and a web.xml file that describes the application.
Jars and Wars contain Java class files and need a Java engine to run. However, I suspect there are tools out there that can package a JRE, with a lightweight server (if one is needed) and the war/jar file into a single "exe" file for Windows.
I just Googled java Windows exe wrappers and found the top four results looking pretty much like what you're after.