Java, for mobile applications - not always free

Java is now one of the most used programming languages, mainly in networks or for web services.
It has been owned by Oracle since 2009, but was developed by Sun programmers in 1995 in response to the incompatibility of too many systems and libraries used by the company. The first version, called Oak, targeted on-board systems but was unsuccessful. The advent of the Internet has given language a chance .
It was built on C++ syntax to remain familiar to programmers, but addresses many of the shortcomings of the language. Using Java instead of C improves performance at the expense of the language, as well as its full standard collection of APIs, graphics, and others.
Java programs are slower than C++ and load well, but run Windows, Linux, Mac, etc. However, during this time, the speed of JVM has improved significantly.
Other languages such as Scala or an interface tool such as JavaFX can be used to improve performance, they run on JVM and use Java libraries.
Java is not the safest language: according to Cisco's annual security report, 91% of virus attacks on computers in 2013 were through Java software, but through applets in the browser.
Java was used on time in conjunction with other languages such as PHP. It was possible to call Java from this language to use its API. This is no longer possible with PHP 5, and by the way, as shown in the JavaScript section, with Node.js. can be done better
Android mobile applications are programmed mainly in Java, where it is compiled for the Dalvik virtual machine.
So we can use Java:
- For portability, it works on the desktop, servers, mobile devices and virtually any operating system.
- For JVM, which also accepts many other languages.
- To have a wide API.
Since the judgment of the US Federal Circuit on May 9, 2014, the Java API has been copyrighted. Judgment that may extend to other APIs. Therefore, you cannot freely use the library, regardless of the owner. APIs cannot be copyrighted in Europe and most other countries.
C successor without C++ flaws
The language was developed as a successor to C, replacing without flaws inherited in C++ or added to it.
- Same syntax as C language.
- Pointers do not exist in Java. Objects are passed by reference, simple variables by value.
- Built-in collection garage and multitasking.
- Each file contains one open class.
- There is no multiple inheritance and operator overload. The interface is a safer alternative to inheritance.
- Femininity is sustained.
- Applets are programs that surf the Web nested inside HTML pages.
- Compiled into a portable bytecode, each system has its own virtual machine to run it.
- SWT is a GUI library that uses system components.
- Swing is a newer version with its own interface components.
- The latest generation of the user interface is JavaFX, which uses a declarative description language.
- You can use C libraries through the JNA interface.
Sample code
Show text letters.
String s = new String("demo"); for(int i = 0; i < s.length(); i++) { char c = s.charAt(i); System.out.print(c); }
Oracle Traps
In 2016, Oracle suddenly decided to check Java SE users and some of them were informed that they had to pay $30,000 in license fees! Source The Register. (English).
This did not apply to runtime JRE users, it no longer exists with Java version 11.
Therefore, it is better to use OpenJDK rather than JDK provided on the official website or via RPM, since only after we understand that this is paid software: Oracle merchants will come and remind you of this.
OpenJDK is free, and you can use various languages in JVM with this library. There is no difference between Oracle JDK 11 and OpenJDK 11 other than the license .
In April 2019, Oracle moved OpenJDK 8 and 11 service to Red Hat, while continuing to manage more recent versions. Since Red Hat was previously bought out by IBM, this ensures its sustainability of its Java-produced products. Other important companies that have migrated to OpenJDK include Amazon and Alibaba.
According to a study conducted by New Relic and published on April 26, 2022, Java Oracle accounted for 75% of the installation fleet in 2020. It is only 34.5% in 2022. Now the Amazon distribution accounts for 22% of objects.
Corretto and Microsoft versions
In response to Oracle's desire to force Java users to pay for the cloud, Amazon, one of the first players in the market with AWS, responded by launching Corretto, its own version of JRE (Java Runtime Environment) based on OpenJDK.
Then Oracle's lawsuit against Google, which ended in victory for Google, opened the way for developers with a peremptory explanation by American justice that the use of API, Java or others was fair and, therefore, without payment rights.
To compete with Amazon, more than Oracle, which is a small supplier, Microsoft decided to release its own version of Java in April 2021 called Microsoft Build of OpenJDK. This distribution is completely free for business and will have long-term support.
EDI and Java Tools
Starting with version 3.7, Eclipse includes a new graphical user interface creation system, bought out by Google and offered to the fund, WindowsBuilder.
Like Dreamweavers, WindowsBuilder has bidirectional code, that is, what is built in visual mode is translated into source code, and what is written in source code is translated into graphic mode, which instantly without having to reassign the page. It supports SWT and Swing.
Starting with 6.9, Apache NetBeans offers a visual designer for JavaFX. This language is designed to easily create graphical interfaces in Java, with a more visual approach. The new version of the NetBeans editor offers him a graphics development tool.
It also allows you to program in PHP, C++, JavaScript and even edit HTML 5 and CSS.
IntelliJ IDEA is similar to NetBeans, offering multiple licenses depending on the type of application. It is a simple and comprehensive tool for Java, JavaFX and other languages, as well as mobile applications. HTML 5 programming assistance and others, including Node.js. Free and open source. (Windows, Mac, Linux).
MIT Inventor makes it easy to create Android apps without programming. This is a visual development tool like Visual Studio, where each component corresponding to a function on an Android phone has a block that can be configured and inserted into the created interface.
It is based on the OpenBlocks Java bookstore.
Compilers and Development Tools
OpenJDK, provided by Oracle without support, is ignored by companies and replaced by other distributions, including in the cloud. There are no more reasons to use Oracle JDK these days, even Android uses the OpenJDK version..
- Microsoft OpenJDK
Free and full distribution of Java by Microsoft with support. - Temurin eclipse.
Another OpenJDK distribution, the Eclipse Foundation. Support provided by Azul. Temurin is an anogram of "runtime." - Red Hat OpenJDK
Free and full version of JDK SE from Red Hat, for Windows/Linux/Mac. No risk of getting an invoice from Oracle. - LLVM
It is possible to convert Java bytecode to LLVM code, which is compiled into binary. - Gradation
Automate tasks to build an application. This Ant and Maven alternative is undoubtedly designed to replace them because it has the benefits of both without their downsides.
Other tools
- Jboss.org
Open source Java application server. - Spark
To counter the growing size of Java libraries, which unnecessarily increase the number of applications, there is a trend towards Java micro-frameworks. These are development tools based on a specialized lightweight library for one type of application, using Maven. Dropwizard, Jodd and Ninja can also be named. - NestedVM
Converts C or C++ code to bytecode for JVM. - Wertks
Node.js equivalent for JVM. JavaScript code can use the Java API. An application platform based on JVM that allows you to create components in various languages, including JavaScript.
Incorrect Java information
Gaussey
Hi
The following page contains inaccurate information about Java: https://www.iqlevsha.ru/programmation/langages-populaires.php
"Multi-platform applications (but slower than native applications)."
Java applications written correctly tend to be no slower or even faster than native applications, according to several IBM researchers specializing in high-performance computing. Java has unthinkable dynamic optimization for purely compiled languages and more freedom to optimize memory usage (since it does not have a pointer), which allows it to receive method calls and memory allocation 2-4 times faster than C++ according to Brian Goetz. Using OpenGL in Java with JOGL, in particular, at least 70% faster than with OpenTk in C #, JNI calls cost about ten nanoseconds, which explains that porting Quake 2 to Java is 15% faster than the original written in C/C + and 30% faster than porting .NET
Finally, when we look closely at your list, the only language that you say is slow is Java, while JavaScript is much more for comparable processing (computing, 3D mapping). The only language that qualifies for criticism on this list is Java, the only language that qualifies for a term with pejorative connotations is Java, which is frankly to the point of denigration. Therefore, I ask you to remove the mention "but slower than native applications" so as not to harm Java developers, some of whom find it difficult to live their passion because of such prejudices, I, in particular, think of video game developers like me who are constantly ridiculed at the same level as this moved piece of the sentence. Please accept my outstanding greetings.
webmaster
Hi
I have no prejudice against any programming language. The article in question was written in 2006 and at that time the Java program was noticeably slower in execution than another compiled into binary code.
Meanwhile, the gap has narrowed as you talk about optimization.
However, even in our time, loading software written in Java as Netbeans with project files takes 1 minute 30 per average configuration, so Java is much slower for this than native software.
Despite this, the article has been modified for updating .
Update: In 2013, JavaScript became faster than Java.