{"id":13992154,"url":"https://github.com/YaroslavGaponov/node-jvm","last_synced_at":"2025-07-22T15:31:20.726Z","repository":{"id":11137429,"uuid":"13502197","full_name":"YaroslavGaponov/node-jvm","owner":"YaroslavGaponov","description":"java virtual machine in pure node.js","archived":false,"fork":false,"pushed_at":"2021-04-26T08:17:35.000Z","size":232,"stargazers_count":2111,"open_issues_count":12,"forks_count":180,"subscribers_count":103,"default_branch":"master","last_synced_at":"2025-07-02T13:12:39.674Z","etag":null,"topics":["java","jvm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YaroslavGaponov.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-11T15:17:47.000Z","updated_at":"2025-06-25T05:05:09.000Z","dependencies_parsed_at":"2022-08-28T20:21:23.842Z","dependency_job_id":null,"html_url":"https://github.com/YaroslavGaponov/node-jvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YaroslavGaponov/node-jvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaroslavGaponov%2Fnode-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaroslavGaponov%2Fnode-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaroslavGaponov%2Fnode-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaroslavGaponov%2Fnode-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YaroslavGaponov","download_url":"https://codeload.github.com/YaroslavGaponov/node-jvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaroslavGaponov%2Fnode-jvm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266520661,"owners_count":23942312,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","jvm"],"created_at":"2024-08-09T14:01:50.499Z","updated_at":"2025-07-22T15:31:20.324Z","avatar_url":"https://github.com/YaroslavGaponov.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","JVM实现"],"sub_categories":[],"readme":"node-jvm  [![Build Status](https://travis-ci.org/YaroslavGaponov/node-jvm.png?branch=master)](https://travis-ci.org/YaroslavGaponov/node-jvm)\n========\n\n\n## Overview\n\nnode-jvm - jvm in pure node.js\n\n\n## Example\n\n### java\n```java\npublic class Main {\n    public static long fib(int n) {\n        if (n \u003c= 1) return n;\n        return fib(n-1) + fib(n-2);\n    }\n    \n    public static void main(String[] args) {\n        if (args.length == 0) {\n                System.out.print(\"help: java Main.class {Number}\");\n                return;\n        }\n        \n        int N = Integer.parseInt(args[0]);\n        long start = System.currentTimeMillis();            \n        System.out.format(\"Fibonacci from 1 to %s:\\n\", N);\n        for (int i = 1; i \u003c= N; i++) {\n            System.out.println(i + \": \" + fib(i));\n        }\n        long stop = System.currentTimeMillis();\n        System.out.println(\"time: \" + (stop - start) + \"ms\");\n        \n        System.out.println(\"done.\");\n    }\n}\n```\n\n### node.js\n```javascript\nvar JVM = require(\"node-jvm\");\nvar jvm = new JVM();\njvm.setLogLevel(7);\nvar entryPointClassName = jvm.loadJarFile(\"./Main.jar\");\njvm.setEntryPointClassName(entryPointClassName);\njvm.on(\"exit\", function(code) {\n    process.exit(code);\n});\njvm.run([15]);\n```\n\n### build java files\n`cd examples/fibonacci; make`\n\n### run jvm\n`./fibonacci.js`\n\n### clean\n`make clean`\n\n### output\n```\nFibonacci from 1 to 15:\n1: 1\n2: 1\n3: 2\n4: 3\n5: 5\n6: 8\n7: 13\n8: 21\n9: 34\n10: 55\n11: 89\n12: 144\n13: 233\n14: 377\n15: 610\ntime: 106ms\ndone.\n```\n\n### other examples\n`cd examples/`\n\n```\narrays - working with different types of arrays \ndogs - simple object-oriented programming\nfibonacci - recursion\njsclass - java and javascript mix\nswitcher - working with different switches\ncast - cast for different types\nex - program exceptions\nex2 - jvm exceptions\nidogs - working with interface\nstatic - working with static objects\nthreads - multithreading\n```\n\n\n## Developer\n\nYaroslav Gaponov (yaroslav.gaponov -at - gmail.com)\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Yaroslav Gaponov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYaroslavGaponov%2Fnode-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYaroslavGaponov%2Fnode-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYaroslavGaponov%2Fnode-jvm/lists"}