A Java virtual machine (JVM) is a virtual machine that can execute Java bytecode. It is the code execution component of the Java platform.
Questions tagged [jvm]
77 questions
142
votes
2 answers
What is a "shaded" Java dependency?
JVM developer here. Lately I've seen banter on IRC chat rooms and even in my own office about so-called "shaded" Java libraries. The context of the use will be something like:
"Such and so provides a "shaded" client for XYZ."
Perfect example is…

smeeb
- 4,820
- 10
- 30
- 49
55
votes
4 answers
Are the development benefits of using Docker negated when using Java compared to other languages closer to Unix binaries?
I had a friend who said:
Docker is amazing. You can use it to replicate production and all its quirks on your local machine. Then you can deploy that instance straight through all the staging workflows super-quick.
Now this would be true if the…

hawkeye
- 4,819
- 3
- 24
- 35
49
votes
4 answers
Why are there multiple different implementations of JVM?
While going over a java book I came across this phrase:
Different JVMs can run threads in profoundly different ways.
While it's completely understandable to me that code can behave differently depending on the underlying JVM implementation, it…

aMimikyu
- 607
- 5
- 8
38
votes
4 answers
What limitations does the JVM impose on tail-call optimization
Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have two mutually recursive functions, you can optimize…

Andrea
- 5,355
- 4
- 31
- 36
37
votes
8 answers
What is the use of converting source code to Java bytecode?
If one needs different JVMs for different architectures I can't figure out what is the logic behind introducing this concept. In other languages we need different compilers for different machines, but in Java we require different JVMs so what is the…

Pranjal Kumar
- 603
- 1
- 5
- 9
33
votes
5 answers
If Scala runs on the JVM, how can Scala do things that Java seemingly cannot?
I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it possible for bytecode compiled from Scala source to be…

Mirrana
- 1,037
- 2
- 12
- 20
28
votes
2 answers
Is it *ever* okay to catch StackOverflowError in Java?
I used to think that it's not, but yesterday I had to do it. It's an application that uses Akka (an actor system implementation for the JVM) to process asynchronous jobs. One of the actors performs some PDF manipulation, and because the library is…

Ionuț G. Stan
- 717
- 6
- 12
22
votes
3 answers
Java and JVM license
Does Java license allow other companies to create their own versions of Java language or just implement it accurately? Same question about JVM.
I heard about Sun suing Microsoft for changing their .NET version of Java implementation and Java for…

Sergey
- 541
- 3
- 7
19
votes
5 answers
What makes JVM so much versatile to support so many JVM languages?
JVM supports so many languages other than Java like Groovy,Clojure,Scala etc which are functional languages unlike Java(I am referring to Java before Version 8 where Lambda's are not supported) that doesn't support functional capabilities.On a high…

Geek
- 5,107
- 8
- 40
- 58
16
votes
1 answer
How can Java be improved so that it no longer needs to perform type erasure?
The official Java tutorial on generics explains type erasure and why it was added to the compiler:
When a generic type is instantiated, the compiler translates those types by a technique called type erasure — a process where the compiler removes…

auser
- 340
- 3
- 11
15
votes
3 answers
When I create an object, is fresh memory allocated to both instance fields and methods or only to instance fields
I have a following class
class Student{
int rollNumber;
int marks;
public void setResult(int rollNumber, int marks){
this.rollNumber=rollNumber;
this.marks=marks;
}
public void displayResult(){
System.out.println("Roll Number=…

Harish_N
- 639
- 4
- 8
- 13
15
votes
4 answers
Approaching Java/JVM internals
I've programmed in Java for about 8 years and I know the language quite well as a developer, but my goal is to deepen my knowledge of the internals. I've taken undergraduate courses in PL design, but they were very broad academic overviews (in…

spinning_plate
- 510
- 3
- 10
12
votes
2 answers
How isolated are static variables?
If I have a
public class SomeClass {
public static final HashMap hashmap = new HashMap();
}
and then I have five different classes with main(String[] args) methods, that I will run.
when they access SomeClass.hashmap, would they be accessing…

ycomp
- 267
- 3
- 8
12
votes
1 answer
Pattern matching in Clojure vs Scala
What are the key differences between pattern matching in these two languages? I am not referring to syntax, but capability, implementation details, range of use cases and necessity.
Scala applications (eg. Lift and Play) speak proudly about the…

kurofune
- 290
- 2
- 8
12
votes
5 answers
How is the JVM and Java's WORA different from other high level languages?
In the Java world, we often talk about the JVM, and when Java was new it had the supposedly killer feature of "Write Once, Run Anywhere."
From the way people talk and write, this seems different from the way that Python, for example, works. Yet…

Eric Wilson
- 12,071
- 9
- 50
- 77