File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Is Decompiling Java Archieves (JAR/WAR/EAR/...) ethical? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Is Decompiling Java Archieves (JAR/WAR/EAR/...) ethical?" Watch "Is Decompiling Java Archieves (JAR/WAR/EAR/...) ethical?" New topic
Author

Is Decompiling Java Archieves (JAR/WAR/EAR/...) ethical?

Sunil Tiwari
Ranch Hand

Joined: Sep 19, 2006
Posts: 49

Here I am in dilemma!

Is decompiling / reverse engineering of someone's else JAR/WAR/EAR/... to peek into code is ethical? [Open Sourced / "Closed" Sourced]
Say you are using some JAR, which is not good documented OR you need to see what's happening "inside" for curiosity?


~ Neil (SCJP)
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12924
    
    3

If it's open source software, you're much better off just getting the source (and documentation) and look at that. Not all information that's in the original source code files is retained in the class files, so decompilers never do a perfect job (you'll never get the exact, original source code back if you use a decompiler).

But even if you are borrowing code from an open source project, you have to carefully read and understand the license. Some open source licenses (such as GPL) require you to make the source code of your own program available if you use GPL software in your own program. And even if you're using open source software with a license that doesn't require you to open up your own program, it's at least a good idea to give credit to the people who wrote the open source software you use (don't steal code and pretend that you've written it yourself).

If it's closed source, it depends if it's legal or not. Some (most?) software licenses of commercial software expressly forbid reverse engineering, so if you do it, you're doing something illegal. Though the Wikipedia page says:
In the United States and many other countries, even if an artifact or process is protected by trade secrets, reverse-engineering the artifact or process is often lawful as long as it is obtained legitimately.

Ofcourse, stealing code (that you've obtained via reverse engineering or other ways) from a commercial product is illegal.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Is Decompiling Java Archieves (JAR/WAR/EAR/...) ethical?
 
Similar Threads
Deploying My project in Jboss server
War with WAR, EAR and JAR
project dependencies ?
EJB unable to access class under war's WEB-INF/classes (ear deployment)
difference btn Jar, War and Ear File