{"id":15069417,"url":"https://github.com/jserv/jamvm","last_synced_at":"2025-04-10T17:36:57.003Z","repository":{"id":146557248,"uuid":"586136736","full_name":"jserv/jamvm","owner":"jserv","description":"JamVM 2 + OpenJDK","archived":false,"fork":false,"pushed_at":"2023-12-03T16:52:30.000Z","size":1805,"stargazers_count":23,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T20:12:37.844Z","etag":null,"topics":["java-virtual-machine","jvm","openjdk","openjdk8"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jserv.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-07T04:03:05.000Z","updated_at":"2025-02-21T16:24:12.000Z","dependencies_parsed_at":"2023-12-03T17:40:53.707Z","dependency_job_id":null,"html_url":"https://github.com/jserv/jamvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jserv%2Fjamvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jserv%2Fjamvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jserv%2Fjamvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jserv%2Fjamvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jserv","download_url":"https://codeload.github.com/jserv/jamvm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262043,"owners_count":21074236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java-virtual-machine","jvm","openjdk","openjdk8"],"created_at":"2024-09-25T01:42:20.209Z","updated_at":"2025-04-10T17:36:56.983Z","avatar_url":"https://github.com/jserv.png","language":"C","readme":"# JamVM + OpenJDK\n\u003e The objective of this repository is to incorporate [OpenJDK](https://openjdk.org/) and [JamVM](https://jamvm.sourceforge.net/).\n\nJamVM is an open-source Java Virtual Machine that aims to support the\nlatest version of the JVM specification, while at the same time being\ncompact and easy to understand.\n\n## Class Libraries\n\nJamVM must be used in conjunction with the Java class-library from OpenJDK\nto make a full Java Runtime Environment.\n\n### OpenJDK\n\n[OpenJDK](https://openjdk.org/) is the official open-source implementation of the JDK resulting\nfrom the open-sourcing of Java in 2007.  It consists of a class-library,\na virtual machine (HotSpot) and a java compiler (plus other tools).\n\nJamVM is compatible with the class-library from OpenJDK 8. JamVM provides\na shared library (`libjvm.so`) which can be used to replace the `libjvm.so`\ncontaining HotSpot. The existing OpenJDK launcher (`java`) is used, which\nnow runs JamVM.\n\nIn addition to HotSpot, OpenJDK also packages and supports alternative\nvirtual machines such as JamVM.  To use JamVM, the `-XXaltjvm=jamvm` option\nis given on the java command line.  This directs the launcher to load the\n`libjvm.so` from the jamvm directory rather than the standard server or\nclient directory.\n\nThe easiest way to get OpenJDKis to install a pre-built package for your system.\n[The Adoptium Working Group](https://adoptium.net/) supports high-quality runtimes\nbased on OpenJDK.  You can then replace HotSpot or the existing JamVM library\nwith the library you have built.\n\n## Supported Platforms/Architectures\n\nJamVM has been written for a Unix/POSIX-compliant system.  Unfortunately,\nincompatibilities between Unixes still exist, and JamVM needs to use several\nnon-portable calls (mostly threading related).  In addition, some architecture\nspecific definitions are required (memory barriers, etc.).  Finally, the\nnative calling convention (or ABI) is both platform and architecture\ndependent.  This is needed by JamVM when constructing a call frame to invoke\na native method.  For most platform/architectures this is provided by\nhighly-efficient hand-written native assembly code.\n\nThe following platforms/architectures are recognized by `configure`.\n| Operating System | Microprocessor Family   |\n|------------------|-------------------------|\n| Linux            | x86, x86-64, Arm, Arm64 |\n| FreeBSD          | x86, x86-64, Arm        |\n| OpenBSD          | x86, x86-64, Arm        |\n| macOS (Darwin)   | x86-64, Arm             |\n\n## Features\n\nFor those interested in the design of virtual machines, JamVM includes a number\nof optimizations to improve speed and reduce footprint.  A list, in no\nparticular order, is given below.\n- Uses native threading (POSIX threads).  Full thread implementation including\n  `Thread.interrupt()`\n- Object references are direct pointers (i.e. no handles)\n- Supports class loaders\n- Efficient thin locks for fast locking in uncontended cases (the majority of\n  locking) without using spin-locking\n- Two word object header to minimize heap overhead (lock word and class pointer)\n- Execution engine supports many levels of optimization (see `configure --help`)\n  from basic switched interpreter to inline-threaded interpreter with stack-caching\n  (aka code-copying JIT, equivalent performance to a simple JIT).\n- Stop-the-world garbage collector, with separate mark/sweep and mark/compact\n  phases to minimize heap fragmentation\n- Thread suspension uses signals to reduce supend latency and improve performance\n  (no suspension checks during normal execution)\n- Full object finalisation support within the garbage collector\n  (with finalizer thread)\n- Full GC support for Soft, Weak and Phantom References.  References\n  are enqueued using a seperate thread (the reference handler)\n- Full GC support for class and class-loader unloading (including associated\n  shared libraries)\n- Garbage collector can run synchronously or asynchronously within its own\n  thread\n- String constants within class files are stored in hash table to minimize\n  class data overhead (string constants shared between all classes)\n- Supports JNI and dynamic loading for use with standard libraries\n- Uses its own lightweight native interface for internal native methods\n  without overhead of JNI \n- VM support for invokedynamic ([JSR 292](https://jcp.org/en/jsr/detail?id=292))\n- VM support for type annotations ([JSR 308](https://jcp.org/en/jsr/detail?id=308))\n- VM support for lambda expressions ([JSR 335](https://jcp.org/en/jsr/detail?id=335))\n- VM support for method parameter reflection\n- JamVM is written in C, with a small amount of platform dependent assembly\n  code, and is easily portable to other architectures.\n\n## Installation\n\nThis section describes how to configure, build and install JamVM on\nyour machine, along with the necessary class libraries.\n\n### Getting the Files\n\nFor JamVM to run, it must also have a class library containing the system\nclasses and the associated native methods (e.g., `java.lang.Object`).\nJamVM 2 has been written to work with OpenJDK.\n\nThe easiest way to get an OpenJDK install that works with JamVM is to get\nan existing package for your system and then overwrite the `libjvm.so`\nfile with the new version.  If you wish to build OpenJDK from source,\nplease refer to the build instructions contained within the source distribution.\n\n## Building and Installing JamVM\n\nTo build JamVM, you must first run `configure` to generate the Makefiles\nspecific to your machine.\n\nFor example, to configure JamVM to use OpenJDK 8, from the directory\ncontaining this file do:\n```shell\n./configure \n```\n\nThis should print out some information and then say it's creating\nthe Makefiles.  If it fails, make sure your machine's architecture\nis supported by JamVM.\n\nThen, to build JamVM, type:\n```shell\nmake\n```\n\nTo install in the default location (/usr/local), type:\n```shell\nmake install\n```\n\nThis installs an executable of JamVM and a `libjvm.so` shared library with\ndebug information (`-g`).  Alternatively, to install a version with no symbols\n(which is much smaller) type:\n```shell\nmake install-strip\n```\n\nNote, you must be root to install in the default location.\n\n\n### configure options\n\nJamVM by default installs in `/usr/local/jamvm`.  You can change the\ninstallation directory by giving configure the option :-\n```\n--prefix=PATH\n```\n\nJamVM supports a number of JamVM specific options to `configure`.\nFor full details do `./configure --help`.  Most of these are concerned\nwith enabling tracing (e.g. `--enable-tracelock`), or selecting which\ninterpreter variant to build.  Unless you want to debug JamVM, or\nexperiment with the interpreter these should not be needed.\n\n### Installing JamVM into OpenJDK\n\nWhen using JamVM with OpenJDK, JamVM's `libjvm.so` file must be\ncopied from its initial install location into the OpenJDK\ninstallation.\n\nThe default install location puts `libjvm.so` into `/usr/local/jamvm/lib`.\n\nOpenJDK allows JamVM as an alternative VM which is invoked using the\n`-XXaltjvm=jamvm` option to java.  To install a new version of libjvm.so,\nlocate the jamvm directory within OpenJDK.  For example, for OpenJDK 8 on\nan x86-64 Debian/Ubuntu system this is `/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jamvm` .\n\nIf installing into OpenJDK, the default HotSpot libjvm.so can be overwritten\nby JamVM's libjvm.so.  When java is executed it will now run JamVM (if\nHotSpot is still required you can create a copy of OpenJDK, and overwrite\nthe libjvm.so in the copy).  HotSpot will be in either the client or server\ndirectory, e.g. `\u003cOpenJDK_PATH\u003e/jre/lib/amd64/server`.\n\nDo the copy (as root), e.g.:\n```shell\nmkdir -p /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jamvm\ncp /usr/local/jamvm/lib/libjvm.so /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jamvm/\n```\n\nTo test the install has been successful, run `java -version`, e.g.:\n```shell\n/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -XXaltjvm=jamvm -version\n```\n\nReference output:\n```\nopenjdk version \"1.8.0_352\"\nOpenJDK Runtime Environment (build 1.8.0_352-8u352-ga-1~20.04-b08)\nJamVM (build 2.0.1-devel, inline-threaded interpreter)\n```\n\nFor Debian/Ubuntu Linux Aarch64, the steps are as following:\n```shell\nsudo mkdir -p /usr/lib/jvm/java-8-openjdk-arm64/jre/lib/aarch64/jamvm\nsudo cp /usr/local/jamvm/lib/libjvm.so /usr/lib/jvm/java-8-openjdk-arm64/jre/lib/aarch64/jamvm\n/usr/lib/jvm/java-8-openjdk-arm64/jre/bin/java -XXaltjvm=jamvm -version\n```\n\nReference output:\n```\nopenjdk version \"1.8.0_352\"\nOpenJDK Runtime Environment (build 1.8.0_352-8u352-ga-1~20.04-b08)\nJamVM (build 2.0.1-devel, inline-threaded interpreter with stack-caching)\n```\n\n## License\n\n`jamvm` is available under GNU General Public License version 2.\nUse of this source code is governed by the GNU GPL that can be found in the [COPYING](COPYING) file.\n\nThis project is developed by Robert Lougher and contributors.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjserv%2Fjamvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjserv%2Fjamvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjserv%2Fjamvm/lists"}