{"id":17685438,"url":"https://github.com/xortroll/libjavm","last_synced_at":"2025-05-12T21:49:43.383Z","repository":{"id":96483119,"uuid":"230637141","full_name":"XorTroll/libjavm","owner":"XorTroll","description":"Small, header-only, zero-dependency C++17 Java VM library","archived":false,"fork":false,"pushed_at":"2021-12-29T14:45:37.000Z","size":802,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-20T18:39:29.601Z","etag":null,"topics":["cpp17","header-only","java","java-library","vm"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XorTroll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"xortroll"}},"created_at":"2019-12-28T16:52:23.000Z","updated_at":"2025-04-13T16:31:13.000Z","dependencies_parsed_at":"2023-04-18T13:38:18.567Z","dependency_job_id":null,"html_url":"https://github.com/XorTroll/libjavm","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/XorTroll%2Flibjavm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XorTroll%2Flibjavm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XorTroll%2Flibjavm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XorTroll%2Flibjavm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XorTroll","download_url":"https://codeload.github.com/XorTroll/libjavm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253830496,"owners_count":21970996,"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":["cpp17","header-only","java","java-library","vm"],"created_at":"2024-10-24T10:27:45.427Z","updated_at":"2025-05-12T21:49:43.359Z","avatar_url":"https://github.com/XorTroll.png","language":"C++","funding_links":["https://patreon.com/xortroll"],"categories":[],"sub_categories":[],"readme":"# libjavm\n\n\u003e Simple, compact, zero-dependency C++17 Java Virtual Machine library\n\nThe only \"dependencies\" it does require are standard C/C++17 libraries, plus the offial Java standard library (`rt.jar` file) since virtually all compiled Java uses it.\n\nNote that, for threading and synchronization items (mutexes, condvars...) you must provide your own implementation. Nevertheless, libjavm provides a default implementation with **pthread** for threading and **standard C++** for sync stuff (`pthread_t`, `std::recursive_mutex`, `std::condition_variable_any`...)\n\nIt provides everything necessary to run Java (8 or lower...?) code in any kind of system.\n\n## Credits\n\n- [python-jvm-interpreter](https://github.com/gkbrk/python-jvm-interpreter), as the original base for the project.\n\n- [andyzip](https://github.com/andy-thomason/andyzip) library, since it's used for JAR loading as an easy-to-use and header-only ZIP file reading library.\n\n- [KiVM](https://github.com/imkiva/KiVM), since it's code was checked for a lot of aspects of the VM.\n\n- [Official Oracle VM specs](https://docs.oracle.com/javase/specs/jvms/se11/jvms11.pdf) (although these are for Java 11)\n\n## Usage\n\nCheck the [examples](examples) directory for some example programs using this library.\n\n\u003e TODO: proper documentation...\n\n## Comparison with JRE\n\nThe tests used to test the VM (slightly modified KiVM tests) are located at [javm-test-suite](javm-test-suite). Currently 26 out of 28 tests are successfully passed (comparing their output with JRE):\n\n- `ArgumentTest`: pass!\n\n- `ArithmeticTest`: pass!\n\n- `ArrayTest`: pass!\n\n- `ArrayTest1`: pass!\n\n- `ArrayTest2`: pass!\n\n- `AssertTest`: pass!\n\n- `ChineseTest`: pass!\n\n- `ClassCastTest`: pass!\n\n- `ClassNameTest`: pass!\n\n- `CovScriptJNITest`: pass!\n\n- `ExceptionTest`: pass!\n\n- `ExceptionTest1`: pass!\n\n- `ExceptionTest2`: pass!\n\n- `ExceptionTest3`: pass!\n\n- `FileTest`: fail (filesystem-related native methods aren't implemented)\n\n- `GCTest`: pass!\n\n- `HashTest`: pass!\n\n- `HelloWorld`: pass!\n\n- `LambdaTest`: fail (dynamic stuff not implemented yet)\n\n- `Main`: pass!\n\n- `PackagePrivateTest`: pass!\n\n- `Polymorphism`: pass!\n\n- `StaticFieldTest`: pass!\n\n- `StaticResolution`: pass!\n\n- `StringBuilderTest1`: pass!\n\n- `ThreadExceptionTest`: pass!\n\n- `ThreadTest`: pass!\n\n## TO-DO list\n\n- Implement `invokedynamic`, `wide`, `tableswitch` opcodes\n\n- Implement not implemented standard native methods (only implemented basic ones to get past initialization, for now)\n\n- Dynamic invoking stuff, related to `invokedynamic` opcode (method handle support, constant pool items related to this...)\n\n- Support or take into account other annotations (currently only `CallerSensitive` is checked)\n\n- The many `TODO` comments spread in code\n\n- (...)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxortroll%2Flibjavm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxortroll%2Flibjavm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxortroll%2Flibjavm/lists"}