{"id":20509351,"url":"https://github.com/raydac/j-j-jvm","last_synced_at":"2025-04-07T07:10:46.865Z","repository":{"id":31074280,"uuid":"34633211","full_name":"raydac/j-j-jvm","owner":"raydac","description":"JVM bytecode interpreter written in Java","archived":false,"fork":false,"pushed_at":"2024-10-03T18:50:51.000Z","size":243,"stargazers_count":83,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T05:08:48.868Z","etag":null,"topics":["engine","java","jvm"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raydac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2015-04-26T21:55:34.000Z","updated_at":"2024-12-24T20:42:38.000Z","dependencies_parsed_at":"2025-01-07T22:19:28.963Z","dependency_job_id":null,"html_url":"https://github.com/raydac/j-j-jvm","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/raydac%2Fj-j-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raydac%2Fj-j-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raydac%2Fj-j-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raydac%2Fj-j-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raydac","download_url":"https://codeload.github.com/raydac/j-j-jvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"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":["engine","java","jvm"],"created_at":"2024-11-15T20:24:09.587Z","updated_at":"2025-04-07T07:10:46.818Z","avatar_url":"https://github.com/raydac.png","language":"Java","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=AHWJHJFBAWGL2"],"categories":[],"sub_categories":[],"readme":"[![Java 5.0+](https://img.shields.io/badge/java-5.0%2b-green.svg)](http://www.oracle.com/technetwork/java/javase/downloads/index.html)\n[![License Apache 2.0](https://img.shields.io/badge/license-Apache%20License%202.0-green.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![PayPal donation](https://img.shields.io/badge/donation-PayPal-cyan.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=AHWJHJFBAWGL2)\n[![YooMoney donation](https://img.shields.io/badge/donation-Yoo.money-blue.svg)](https://yoomoney.ru/to/41001158080699)\n\n# History\nIn 2009 during my vacation time I was playing with code and made experiments to develop pure Java JVM interpreter which could be compatible with J2ME CLDC 1.0 (it didn't provide any possibility to load external class, and the task was not only academic one). During three days the interpreter was successfully written, and I got some \"proof of concept\". The result worked well and more or less fast on Nokia 6100. Then I published the project as OSS one on my home page (titled as \"M-JVM\").  \n\nIn 2015, my home page was reworked and old projects were removed. But because such project can be still useful for someone (as minimum for learning purposes), I made refactoring and published its sources on GitHub under title J-J-JVM project. Some improvements were made in the published project: added support of inner classes, added support for double and long values, added dozens of tests. The library written in manner to be compatible with Android API 2.0r1+.    \n\n__The JVM interpreter doesn't contain any \"Poka-yoke\" (mistake-proofing) mechanism and verification of byte-code, it doesn't make any stack map verification and any requests or communication with Java security manager !__\n\n# How to build\nIt is a regular maven project and doesn't have any magic, just build through `mvn clean install` in the root of the project. __WARNING! THE PROJECT STRONGLY REQUIRES JDK 1.8 FOR BUILD!__\n\n# Hello world\nFor instance, you can see below class writing just \"Hello world!\" on console.\n```Java\npackage com.igormaznitsa.testjjjvm;\n\npublic class HelloWorld {\n  public static void main(final String ... args){\n    System.out.println(\"Hello world!\");\n  }\n}\n```\nLet use Javassist to load the class but make some changes in its execution with J-J-JVM library.\n```Java\nJJJVMProvider provider = new JSEProviderImpl(){\n  @Override\n  public Object invoke(JJJVMClass caller, Object instance, String jvmFormattedClassName, String methodName, String methodSignature, Object[] arguments) throws Throwable {\n    if (jvmFormattedClassName.equals(\"java/io/PrintStream\") \u0026\u0026 methodName.equals(\"println\") \u0026\u0026 methodSignature.equals(\"(Ljava/lang/String;)V\")){\n      System.out.println(\"\u003c\u003c\"+arguments[0]+\"\u003e\u003e\");\n      return null;\n    }\n    return super.invoke(caller, instance, jvmFormattedClassName, methodName, methodSignature, arguments); //To change body of generated methods, choose Tools | Templates.\n  }\n};\nJJJVMClassImpl jjjvmClass = new JJJVMClassImpl(new ByteArrayInputStream(javassist.ClassPool.getDefault().get(\"com.igormaznitsa.testjjjvm.HelloWorld\").toBytecode()), provider);\njjjvmClass.findMethod(\"main\", \"([Ljava/lang/String;)V\").invoke(null, null);\n```\nand the code above will print\n```\n\u003c\u003cHello world!\u003e\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraydac%2Fj-j-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraydac%2Fj-j-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraydac%2Fj-j-jvm/lists"}