a free solution to package java web application with tomcat to an exe

I made a java web application that uses hibernate, spring and jsf. it is deployed on tomcat 7. I want to distribute it to external users, but I'm afraid that someone can decompile classes and get back to java code.

Excelsior JET fits my needs because it packages Tomcat and the war file of the web application into an exe file that can be distributed to third party.

BUT Excelsior is very expensive for me and I'm looking for a free solution to pack all the staff into one exe file.

EDIT : If I use obfuscation. it's going to modify methods and fields names. the problem is that I'm calling them from my xhtml files. they won't be accessible anymore.

Answers


You could obfusticate your code for free using ProGuard. There are other solutions that'll do this too, but they might not be free.


As david99 suggests, the most you can do is obfuscate the code (ProGuard or yGuard comes to mind). This avoids casual reverse engineering -- although no obfuscation is perfect. Any binary can be seen as "obfuscated code" -- given enough time, all (self-contained) programs are crackable; and Java bytecode is no exception.

From the obfuscated .war, you can easily generate a self-contained .war that packages a light-weight servlet-container in it: see executable-war.

The result would be people executing your code either by standard deployment or as

java -jar nameOfApp.war

If this is still too complicated for end-users, you can wrap it up as an .exe with launch4j. The whole toolchain is fee as in beer and speech (yGuard's code is proprietary though; but really easy to configure), and can be integrated into a maven/ant build.

Otherwise, you can build an installer that installs a pre-configured tomcat with the application in it. I have personally used izpack. However, adding this to a mavenized build may be harder.


Need Your Help

Neural network training. Only few outcomes

neural-network encog

I have a network which has 3 inputs, 2 hidden layers (6 neurons each, Sigmoid activation function) and one neuron as output. I expect my network to be continuous, as I'm not looking at a classifica...

Choose one of many Internet connections for an application

c# network-programming

I have a computer with a few different internet connections. LAN, WLAN, WiFi or 3G. All of these are active and the machine can use any of them.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.