Did you see that Java uses the GPL open source software protocol? You can modify, copy and sell the software in any form for the common library or software using GPL protocol. However, there is a restriction that once you publish the software, you must publish your source code to your publishing target, otherwise you will not abide by the original GPL agreement (that is, if you use a GPL-based library in your software and you sell your software as A, you must also provide the source code to A). This is the general GPL protocol, and although java also uses the GPL open source protocol to open the code of java system class library, its protocol also puts forward an exception, that is, as long as you modify the class code provided by java itself, you can't disclose your source code to software publishers. This is why java can be used for free. Generally speaking, open source code is unfair.
However, China's awareness of copyright is relatively weak. Many softwares use GPL open source libraries, and there is no open source code. Strictly speaking, this is an act of copyright infringement. The Free Software Foundation can sue the developer in court according to the agreement. .............