Skip to main content
179 votes

What is a "shaded" Java dependency?

Shading dependencies is the process of including and renaming dependencies (thus relocating the classes & rewriting affected bytecode & resources) to create a private copy that you bundle ...
Hugues M.'s user avatar
  • 1,902
125 votes
Accepted

Why are there multiple different implementations of JVM?

Why might I, as a developer be dissatisfied with the official JVM implementation that Oracle provides and decide to build up a different one? Which one? Oracle has at least three different official ...
Jörg W Mittag's user avatar
87 votes
Accepted

Are the development benefits of using Docker negated when using Java compared to other languages closer to Unix binaries?

Not at all. Imagine you're running the version 1.8.0 of Java on both your development machine and the server. By the way, you're working simultaneously on two projects, both using Java. One day, a ...
Arseni Mourzenko's user avatar
79 votes
Accepted

What is the use of converting source code to Java bytecode?

The logic is that JVM bytecode is a lot simpler than Java source code. Compilers can be thought of, at a highly abstract level, as having three basic parts: parsing, semantic analysis, and code ...
Mason Wheeler's user avatar
35 votes

Are the development benefits of using Docker negated when using Java compared to other languages closer to Unix binaries?

You rarely just deploy a "Java App". Your java application has a lot of different support programs around it. We use Apache HTTPD, Apache Tomcat, ActiveMQ for messaging, an FTP Deamon, MySQL and a ...
Bill K's user avatar
  • 2,739
27 votes

What is the use of converting source code to Java bytecode?

Intermediate representations of various sorts are increasingly common in compiler / runtime design, for a few reasons. In Java's case, the number one reason initially was probably portability: Java ...
IMSoP's user avatar
  • 5,877
26 votes

Why are there multiple different implementations of JVM?

Java is a spec, not a product Java is not a specific product or binary. The Java platform is defined by a set of specifications for the language and the JVM, plus JSRs and JEPs. You said: the ...
Basil Bourque's user avatar
14 votes
Accepted

What prevents Java from achieving C-level portability?

Java is portable in the sense that C or C++ can be portable: the same source code can be used for multiple operating systems or processor architectures. In fact this is a lot easier in Java, since the ...
amon's user avatar
  • 135k
10 votes

What is a "shaded" Java dependency?

Let me answer the question with the help of the software actually responsible for creating shaded jars ... at least when using maven. Taken from the Apache Maven Shade Plugin home page: This ...
Jesko R.'s user avatar
  • 307
10 votes

Different types of heap in java

While the other answers are giving good information about the internal details of certain various JVM heap designs, from the programmer's perspective, there is only one heap and one way to use it -- ...
Erik Eidt's user avatar
  • 34.2k
9 votes

Are the development benefits of using Docker negated when using Java compared to other languages closer to Unix binaries?

This question would also be pertinent for golang, where you can just extract statically linked binaries and run them somewhere, as opposed to Python or C++ where you usually have a large number of ...
Yannick's user avatar
  • 99
8 votes
Accepted

How does Java improve over C++ in the area of portability?

The advantage to you is that if there is already a good JVM for of all your target platforms, all you really need to do is release your Java application once and it should just run on all of them. You ...
FrustratedWithFormsDesigner's user avatar
8 votes

What is the use of converting source code to Java bytecode?

There seem to be at least two different possible questions here. One is really about compilers in general, with Java basically just an example of the genre. The other is more specific to Java the ...
Jerry Coffin's user avatar
  • 44.5k
8 votes

What is the use of converting source code to Java bytecode?

It sounds like you're wondering why we don't just distribute source code. Let me turn that question around: why don't we just distribute machine code? Clearly the answer here is that Java, by design, ...
Joel Coehoorn's user avatar
7 votes

Different types of heap in java

tl;dr summary: I couldn't find much information online. Are there different types of heap memory available in Java ? Short answer: No. Slightly longer answer: The Java Language Specification does ...
Jörg W Mittag's user avatar
7 votes

Does the JVM compile bytecode into machine code and run it or does it just run bytecode directly?

Java source code is compiled into bytecode for the JVM. That is not necessarily true. There is nothing in the Java Language Specification that prescribes any particular implementation strategy. The ...
Jörg W Mittag's user avatar
6 votes
Accepted

What did James Gosling mean when told that C# is Java with no reliability, productivity and security?

C# incorporates "unsafe" capabilities that allow pointer manipulation. C#'s underlying platform, CLR/CLI (.NET bytecode), was intended to be somewhat more language agnostic than Java (and Java's byte-...
Erik Eidt's user avatar
  • 34.2k
6 votes

Are the development benefits of using Docker negated when using Java compared to other languages closer to Unix binaries?

This is a really good question but after working with Docker, I would turn it around: Are the benefits of the JVM negated by containerization (e.g. Docker)? Containers really challenge a lot of ...
JimmyJames's user avatar
  • 27.6k
6 votes
Accepted

Different types of heap in java

Heap is divided Young Generation, Old or Tenured Generation, and Permanent Generation. The Young Generation is where all new objects are allocated and aged. When the young generation fills up, this ...
RK_Aus's user avatar
  • 241
6 votes

What prevents Java from achieving C-level portability?

a Java application depends on a JVM being present. That is not true. There is nothing in the Java Language Specification that says anything about the JVM. Oracle is pretty strict about keeping the ...
Jörg W Mittag's user avatar
6 votes
Accepted

To show the difference between system VMs and JVMs

It's fine as is, if you think about it the right way. You can think of a Virtual Machine as a task running on the hypervisor. They get context switched nearly the same way after all. Tasks and Apps ...
candied_orange's user avatar
6 votes
Accepted

Implementation of variables in JVM / Java

The very first sentence of the chapter you quoted, Chapter 2. The Structure of the Java Virtual Machine says [bold italic* emphasis mine]: This document specifies an abstract machine. It does not ...
Jörg W Mittag's user avatar
5 votes

How does Java improve over C++ in the area of portability?

If you have 10 programs and 10 platforms, you need 100 binaries for C++ (compiling each program to each platform), but only 20 binaries for Java (10 of your programs to Java, 10 of the JVM to the ...
Jörg W Mittag's user avatar
5 votes
Accepted

How's .NET multi-platform approach different than Java's back in the days?

It's not. .Net code compiles to IL which is run on a CLR Its always been multi-platform in this sense and Mono has been around for a while now. http://www.mono-project.com/ I guess what you are ...
Ewan's user avatar
  • 77k
5 votes
Accepted

How do Virtual Machines allocate memory?

How does the JVM allocate the amount of data needed? A virtual machine may use malloc, but it likely is a lower level system call. However, they typically allocate huge blocks and carve individual ...
Erik Eidt's user avatar
  • 34.2k
5 votes

How does Java improve over C++ in the area of portability?

How does Java improve over C++ in the area of portability? It's also worth addressing this larger question. The two languages have different "portability" goals. Java has a goal of "write once, run ...
Jerry101's user avatar
  • 5,427
5 votes

Why are some languages called platform dependent if I can always share the source code?

can always be achieved (even in "platform dependent" languages like C) by sharing the source code which the new machine's compiler will use to compile the machine language code specific to ...
Charles E. Grant's user avatar
5 votes
Accepted

Java: Is there a performance difference between variable assignment vs. inline usage?

The JVM and Java compiler have been continuously optimized for literally decades now, so its extremely unlikely that they would miss a trick so basic that this would make a difference. However, we don'...
Kilian Foth's user avatar
4 votes

Java Design Philosophy

It utilizes code signing certificates. Or simplified there's essentially a checksum added to the file together with some more information on who generated said checksum. It's a bit more complicated ...
Mario's user avatar
  • 1,509
4 votes

What the fastest way to pass large data between JVMs?

Why don't you use pure sockets? A socket on the same machine will send data over pretty quickly. Assuming you can send 100 MB\s over, you should be able to send 1 MB in roughly 10 ms. Getting higher ...
Luke Melaia's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible