en.wikipedia.org
Criticism of Java - Wikipedia
Excerpt
The Java programming language and Java software platform have been criticized for design choices including the implementation of generics, forced object-oriented programming, the handling of unsigned numbers, the implementation of floating-point arithmetic, and a history of security vulnerabilities in the primary Java VM implementation, HotSpot. Software written in Java, especially its early versions, has been criticized for its performance compared to software written in other programming languages. Developers have also remarked that differences in various Java implementations must be taken into account when writing complex Java programs that must work with all of them. ## Language syntax and semantics ### Checked exceptions Java introduced checked exceptions where a method must declare the checked exceptions it throws in the method signature. This can result in unnecessarily verbose boilerplate code. No major language has followed Java in implementing checked exceptions. ### Generics When generics were added to Java 5.0, there was already a large framework of classes (many of which were already deprecated), so generics were implemented using type erasure to allow for *migration compatibility* and re-use of these existing classes. This limited the features that could be provided, compared to other languages. … Additionally, in 2016, the following example was found revealing Java to be unsound and in turn making JVMs which threw ClassCastExceptions or any other kind of runtime error technically non-conforming. This was corrected in Java 10. … ### Noun-orientedness By design, Java encourages programmers to think of a solution in terms of nouns (classes) interacting with each other, and to think of verbs (methods) as operations that can be performed on or by that noun. Steve Yegge argues that this causes an unnecessary restriction on language expressiveness because a class can have multiple functions that operate on it, but a function is bound to a class and can never operate on multiple types. … ### Unsigned integer types Java lacks native unsigned integer types. Unsigned data is often generated from programs written in C, and the lack of these types prevents direct data interchange between C and Java. Unsigned large numbers are also used in a number of numeric processing fields, including cryptography, which can make Java more inconvenient to use for these tasks. … ### Operator overloading Java has been criticized for not supporting user-defined operators. Operator overloading improves readability, so its absence can make Java code less readable, especially for classes representing mathematical objects, such as complex numbers and matrices. Java has only one non-numerical use of an operator: … instances. It is impossible to create user-defined operator overloads. ### Compound value types Java lacks compound value types, such as structs in C, bundles of data that are manipulated directly instead of indirectly via references. Value types can sometimes be faster and smaller than classes with references. For example, Java's … ### Large arrays Java has been criticized for not supporting arrays of 2^31^ (about 2.1 billion) or more elements. This is a limitation of the language; the *Java Language Specification*, Section 10.4, states that: Arrays must be indexed by int values... An attempt to access an array component with a long index value results in a compile-time error. Supporting large arrays would also require changes to the JVM. This limitation manifests itself in areas such as collections being limited to 2 billion elements and the inability to memory map continuous file segments larger than 2 GB. Java also lacks (outside of its 2D arrays) multidimensional arrays (contiguously allocated single blocks of memory accessed by a single indirection), which limits performance for scientific and technical computing. ### Integration of primitives and arrays Arrays and primitives are somewhat special and need to be treated differently from classes. This has been criticized because it requires many variants of functions when creating general-purpose libraries. … ### Lack of tuples Java does not natively support tuples, resulting in a proliferation of third-party implementations which must be imported and handled by the programmer. The argument against a generic tuple class is the danger it poses in proliferating unmaintainable code. … Game designer and programmer John Carmack concluded in 2005 about Java on cell-phones: "The biggest problem is that Java is really slow. On a pure CPU/memory/display/communications level, most modern cell phones should be considerably better gaming platforms than a Game Boy Advance. With Java, on most phones you are left with about the CPU power of an original 4.77 mhz (sic) IBM PC, and lousy control over everything." … Critics have suggested that users do not update their Java installations because they don't know they have them, or how to update them. Many organisations restrict software installation by users, but are slow to deploy updates. Oracle has been criticized for not promptly providing updates for known security bugs. When Oracle finally released a patch for widely-exploited flaws in Java 7, it removed Java 6 from users' machines, despite it being widely used by enterprise applications that Oracle had stated were not impacted by the flaws.
Related Pain Points
Slow Java security updates and forced JVM downgrades
7Oracle is slow to provide updates for known Java security bugs and has performed forced downgrades (e.g., removing Java 6 despite assuring enterprise users it wasn't affected) during patch deployments.
Historical Java performance is poor on resource-constrained devices
6Java's performance on mobile and embedded systems is notably poor. Game designer John Carmack noted Java phones had CPU power equivalent to a 4.77 MHz IBM PC despite modern hardware being far superior.
Value Types and Generic-Primitive Mismatch Causes Performance Inefficiency
6Java's lack of true value types and inability to mix generics with primitives leads to excessive cache misses and memory overhead, making numeric and high-performance applications less efficient than C or C#.
Type erasure limits generic features and expressiveness
6Java's generics were implemented using type erasure for backward compatibility, limiting available features compared to other languages. A 2016 discovery revealed Java generics to be unsound, causing ClassCastExceptions and runtime errors.
Lack of unsigned integer types prevents C interoperability
5Java lacks native unsigned integer types, preventing direct data interchange with C programs that generate unsigned data. This is particularly problematic for cryptography and numeric processing fields.
Checked exceptions create verbose boilerplate code
5Java's checked exceptions require methods to declare all thrown exceptions in signatures, resulting in unnecessarily verbose boilerplate code. No other major language has adopted this pattern, making it a Java-specific burden.
Array indexing limited to 2.31 billion elements
5Java's array indexing is restricted to int values (2^31 elements), creating bottlenecks for collections, memory-mapping files larger than 2 GB, and scientific computing. Fixing this requires JVM-level changes.
Forced object-oriented noun-oriented design restricts expressiveness
4Java's design philosophy forces developers to think in terms of nouns (classes) with verbs (methods) bound to them. This restricts language expressiveness because functions cannot operate on multiple types—a function is bound to a single class.
Lack of native tuple support creates library proliferation
3Java does not natively support tuples, forcing developers to import and manage numerous third-party implementations. This creates maintenance challenges and code fragmentation.
No user-defined operator overloading reduces code readability
3Java does not support user-defined operator overloading, making code less readable for classes representing mathematical objects like complex numbers and matrices.