Skip to main content
126 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
27 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
  • 136k
8 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
7 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
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
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

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 two ...
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
  • 84.6k
3 votes
Accepted

Do I have do use HashTables/Maps/Hashmaps in this algorithm?

In both cases, you have an O(n^2) algorithm - you have a loop (either explicitly in your recursive case or implicitly as part of map in the iterative case) which calls contains. contains has to ...
Philip Kendall's user avatar
3 votes

Can Java applications run on phones (at least android) AND Windows?

Java applications are run on a java virtual machine, which is what allows them to work on multiple platforms. However, android sdks have quite a few additional libraries and features pertaining ...
Neil's user avatar
  • 22.9k
2 votes

How to access version of a Java application programmatically when running from an IDE?

A possible approach is to generate some of your Java code (with tools like GNU autoconf, or GPP) to contain version specific information. Another approach might be to script your GNU emacs editor to ...
Basile Starynkevitch's user avatar
2 votes

What prevents Java from achieving C-level portability?

TL;DR: Apart from the legal/business issues others already mentioned, there are indeed technical limitations. Roughly speaking, creating a reasonably good JVM is harder than a reasonably good C ...
Michał Kosmulski's user avatar
2 votes

What prevents Java from achieving C-level portability?

But, what prevents a Java application from shipping within a JVM wrapper? I think you got it wrong: if there's a JVM implementation, then the battle is already won, regardless of whether said JVM is ...
Andres F.'s user avatar
  • 5,159
2 votes

Are JVM thread dumps a security concern?

It is a kind of information leakage. An attacker armed with this could figure out what libraries you are using and possibly figure out the versions using the stack trace information. This would ...
Sign's user avatar
  • 2,733
2 votes
Accepted

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

Byte code usually cannot be run directly on the processor, since the hardware doesn't have the opcodes aload, getfield etc. The JVM either interprets the byte code, i.e. it looks up the things to do ...
Kilian Foth's user avatar
2 votes

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

how does JVM convert bytecode into machine code? The keyword you need is "JIT compilation"; JIT stands for "just in time", i.e. it runs immediately before trying to execute the ...
pjc50's user avatar
  • 15.3k
1 vote

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

When is a language platform independent? A programming language is only a way to express something in source code in an easy way. As soon as nothing in this expression is platform specific (os or ...
Christophe's user avatar
  • 82.3k
1 vote

Can Java applications run on phones (at least android) AND Windows?

I would recommend React Native This is a framework written by Facebook that allows you to write mobile applications that work on both platforms using javascript. If you wish to learn about React ...
Jake Perkins's user avatar
1 vote

What prevents Java from achieving C-level portability?

Size and speed is two huge factors. A JVM is a pretty huge program that needs a lot of RAM and storage space to be used. A JVM is also often slower (depending on the workflow). This means that Java ...
iveqy's user avatar
  • 468
1 vote

Java and JVM license

The answers to this question are not correct. You are not free to develop software from the Java specifications, look at the license info in the appendix of specification papers: "License for the ...
user1086516's user avatar

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