Java implementation of a... JVM?
The Jikes RVM is probably the most prominent JVM implementation written in Java. However, its lowest level implementation simply consists of static method calls to a "magic" interface which is treated specially by the compiler and translated into native code.
The Maxine VM (developed originally by Sun Labs, now Oracle Labs) is a real metacircular VM, in which not only everything is written in Java, but there is no special-casing in the compiler going on. Even more: not only is the Maxine VM written in Java, it even runs in itself! This might sound crazy, and to be frank, I have no idea how that works, but it is based on the Klein VM (developed by Sun Labs) which does the same thing for the Self programming language.
This has some very interesting properties: since the JVM itself is part of the codebase that the JVM interprets, the same codebase that the user code belongs to, this means that it can do optimizations such as inlining across the VM boundary. IOW: it can inline VM code into the user code and vice versa. It also means that the VM itself is subject to the same runtime profiling and dynamic optimizations that – on other VMs (even including Jikes) – only the user code is, which means that the VM itself constantly gets re-compiled and re-optimized to adapt to changing loads, new classes being loaded, changing profiles, changing usage patterns and so on.
On VMs like HotSpot, JRockit, J9 and others, these optimizations are impossible, for the simple reason that the JVM only knows how to optimize JVML bytecode, but the VM isn't written in Java. But even in Jikes, this is not possible because, while the VM is written in Java, it gets statically compiled to native code before it runs, and the code of the VM itself is not part of the code that the VM "sees".
The Squawk VM is also a JVM developed by Sun Labs, now Oracle Labs. Unlike Maxine, which is roughly similar to J9, HotSpot or JRockit in its target audience, Squawk is more analogous to the KVM (originally developed by Sun, now Oracle), i.e. targeted at resource-constrained embedded devices. Squawk is also inspired by Klein. Unlike Maxine, it has a small abstraction layer written in C. But keep in mind, that Maxine requires an OS to run, whereas Squawk runs without an OS. So, in a sense, Squawk is even purer than Maxine, because many parts that are not part of Maxine but part of the OS (where they are often implemented in C, C++ or other low-level languages), are actually part of Squawk itself. Device drivers, for example, are written in Java. Only a small hardware abstraction layer and I/O libraries are written in C.
JNode is a JVM + operating system written in Java that runs one a bare x86 PC or virtual. The project's SVN has been pretty inactive of late (roughly the last 6 months), but I believe there is activity in the GIT mirrors for the project.
An interesting Java JVM implementation is this one:
https://gitlab.com/neoexpert/jvm
It is able to run simple Java Programs and some advanced ones. It should also be able to run itself. It has also a subproject which contains an JavaScript implementation of JVM which is able to run in Browser. It is very fast. You can run the JS implementation with:
mvn clean install
cd jsjvm
./run.sh
The JavaScript implementation does have a simple JDK which contains some classes for DOM Manipulation and WebGL bindings. I am planning to implementat the JDWP (Java Debugger Wire Protocol) for it. If it is done, you will be able to connect with a Debugger (for example from IntelliJ) and debug Java code which is running in Browser.
Jikes RVM is a JVM written in Java, used for research and kept under active development.