Any class file can be decompiled to original Java source code relatively easily.
Does this mean that the source code of any Java program, unless encrypted in some way, is relatively easily available to anyone who has the final program?
If so, then isn't this a problem for major companies that don't want their trade secrets or their work available to anyone?
Open source refers to license. You can have the source code of a non-open source program, for example.
Generally speaking, no, your original source code is not available to anyone - you can easily use methods such as obfuscation and encryption if you are concerned about this. Check out this question.
However Java bytecode can be reverse engineered to Java source code. You can take a look here to get more information: http://resources.infosecinstitute.com/java-bytecode-reverse-engineering.
If so, then isn't this a problem for major companies that don't want their trade secrets or their work available to anyone?
Why would it be? Java is usually running on the server side, where you can't even access the bytecode. If you're creating a desktop application you're just as likely to have it reverse engineered as pirated, I'd wager.
In essence it's possible to get the source code from bytecode, but you can prevent that, and it's usually not a big deal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With