Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are the ethics behind unjar-ing a jar file from the industry standpoint when let's just say you weren't given the implicit OK to use and edit? I don't want this to be an open-ended question. Is it unethical and should this be avoided at all costs? Or can this be used as "inspiration"?



migration rejected from Nov 2 '15 at 2:56

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as unclear what you're asking by MichaelT, gnat, Snowman, durron597, Dan Pichelman Nov 2 '15 at 2:56

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Did you accept a EULA that prohibits it? – parsifal Aug 18 '11 at 18:29
Nope............ – O_O Aug 18 '11 at 18:30
What is the license that was distributed with the jar? – Jeremy Heiler Aug 18 '11 at 18:31
Don't think there was any license included with the jar. – O_O Aug 18 '11 at 18:33
@Anna Lear: At the end of the question the OP asks: Or can this be used as "inspiration"? So I think the OP wants to know is simply opening the JAR unethical, or is it OK to open it and learn from it? The OP never asks about extracting and using/modifying the code with the intent to pass it off. I think they are just asking about the ethics of browsing through someone else's JAR and reading the code to figure out how it works. – FrustratedWithFormsDesigner Aug 18 '11 at 18:43
up vote 6 down vote accepted

Intent matters here. If you intend to look at what they did and copy it and sell it as your own then yes it is unethical.

If you are looking to see is there is some weakness you can exploit then yes it is unethical.

If you are wanting to make sure that you are not bringing something on to your network that is going to create havok then I would say no it is not unethical.

The other thing that matters are your actions. If it was not your intent originally to steal it but after seeing how they did it you decide to write your own then that would be unethical.

If after looking at it you decide to go with a different vender because you did not like what you saw under the hood I do not think is unethical.

Could you clarify this a bit? It seems like the intent is the unethical thing, not the opening and viewing of a jar file. Because without telepathic ability, I can't observe someone doing "unzip -l blah.jar", and then deeming it "ethical" or "unethical" by your standard. – Bruce Ediger Aug 18 '11 at 20:56
@Bruce - No you can not. This is an ethical judgement not a legal one. I suppose if you are in a position to judge the ethicality someone elses actions on this you will need to ask them why they did it and what they intend to do now. – Chad Aug 19 '11 at 13:13
OP states there was no license. Since a JAR file is simple to open for any computer savvy person, certainly for any developer, by distributing the JAR file in such manner, the distributor has essentially declared: "I don't care - do what you like with it". No 'ethical problem' here, regardless. If there is some sort of license or NDA attached, then even if it may not be legally enforceable, ethical considerations would come into play IMO. – Vector Apr 5 '13 at 23:28
@Vector: It's absolutely not true that the lack of a license means "do what you like with it" - quite the opposite, actually. It means you have no rights at all. If you got it from the author, that might constitute an implicit right to use it, but definitely not to modify or redistribute. – Michael Borgwardt Aug 22 '13 at 8:25
@Vector: Legally you have full rights of ownership until you have explicitly renounced it and a finder has established this fact. But arguments by analogy are very questionably, and in fact completely meaningless in legal contexts. If we are talking about the practical ethical considerations, it's reasonably simple: if you know the author, ask. If you don't know the author, assume that you have no rights at all, since you cannot even know whether the author himself wanted it to be distributed. – Michael Borgwardt Aug 22 '13 at 9:35

What's the license? Have you signed something (such as an EULA, which are debatable if they are even legal) that told you that you were forbidden from modifying the JAR file?

I'm guessing that modifying the JAR file is of the same ethics as looking at/modifying a compile binary. Whether or not you think that's moral/ethical is up to you/the courts.

There was no license. Would that mean it is free to use? – O_O Aug 18 '11 at 18:37
@O_O No license does not automatically mean that it is free to use. Do some research from the source of the JAR file to find out if there is some license that you didn't see before. – Jesper Aug 18 '11 at 19:14
No license means precisely that it is not free to use. Unless there are license terms which grant you other rights, creations are covered by Copyright, which forbids anyone from the copyright holder from copying or making derivative works (within the limited boundaries of Fair Use exceptions) – Trevor Powell Aug 19 '11 at 0:27

A Java Jar file is just a format for aggregating/compressing files, nothing more. Specifically,

JAR files are built on the ZIP file format. Computer users can create or extract JAR files using the jar command that comes with a JDK. They can also use zip tools to do so.

For instance, 7zip can read them. So I wouldn't say there are any ethical or legal barriers to reading the code, and learning from it.

As for making changes to them, as others have said, that partly depends on intent (and possibly what you do with the results - I am not a lawyer :). For some programs, such as Minecraft, the author even encourages people to make modifications to the basic program (which require installing changes into the .jar file).

Great example with Minecraft. :) – O_O Aug 18 '11 at 19:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.