File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Security of Java Jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Security of Java Jar file" Watch "Security of Java Jar file" New topic

Security of Java Jar file

Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

As we know that we can extract a jar file and these class files can be decompiled
then how can we secure a jar file.

i also want to know how make a setup or exe of jar file in JAVA
Stephan van Hulst

Joined: Sep 20, 2010
Posts: 4627

What would you call secure? Given enough dedication, it's *always* possible for someone to reverse engineer your code.

For installers I can recommend install4j. It can bundle a JVM with your Java program, saving the user the effort of downloading it themselves.

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

Ok sir,
Please tell how to made a setup or .exe
so that it need to be install like other softwares..
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15091

Here is a list of Java installer generators. I've used IzPack myself in the past.

If you really want to make it impossible for anyone to reverse engineer your code, then you could make it a web application that runs on a server. People using the web app through their browsers will not be able to get at the code that is running on the server.

If it has to be code running on the client's computer, then there is no way to 100% guarantee that nobody can get at the code. There are some products, called obfuscators, that make the code harder to read, but someone who really wants to could in principle still reverse engineer it.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Joydeep Ghatak
Ranch Hand

Joined: Sep 30, 2009
Posts: 41

Hi Gursewak,

You can use "InstallAnywhere" software which I had used long back.
It was good and easy to use.

you can have some more information on that as follows,

Also you need to make sure what will be your usage ambit, "commercial" or "personal", before using one free version of any software.

On "secure code", I think other members had provided the valuable information already.

~ Joydeep

“Men are only as good as their technical development allows them to be.”
I agree. Here's the link:
subject: Security of Java Jar file
It's not a secret anymore!