i have create desktop based application using java language.
now i want to give it to my client so for that i want to create executable file for java prgram
so how can i create .exe file from java program?

Recommended Answers

All 7 Replies

You don't. Java is cross-platform, and exe files are not.
Give him the jar file and it will run on his Windows/Linux/Mac computer - anywhere with a JRE installed.

If for some obscure reason you absolutely must have an exe file for some specific operating system there are a couple of cludgy third-party utilities that make it work that way - just Google for them, but I can't recommend any.

ok
but i don't want to show my code to client
when i use jre, then it is possible to see code
so for this reason , i have to make .exe file
i searched alot on net but there are some tools like (launcg4j, etc) to create .exe but that exe files are running on my machine only but not others machine

I understand, although all they can see is the generated byte code, not your source.
Even creating an exe won't prevent a determined programmer from reverse-engineering or hacking it, so all you can ever achieve is a good enough deterrent.
You can obfuscate your shipped code to make it very hard to read or understand - it replaces variable names by meaningless random strings, shuffles code around (without changing its results) etc. That's certainly enough to stop any but the most comitted programmer. There are utilities that do it for you - google java obfuscate

i will try java obfuscate.. ok and this code will again run it on eclipse also?

Yes

i got proguard but it doesn't work good

I have never tried any of these tools, so sorry, but I can't help you with them.
Good luck.
JC

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.