René's URL Explorer Experiment


Title: java.lang.NoClassDefFoundError after compiled into executable · Issue #566 · joeferner/node-java · GitHub

Open Graph Title: java.lang.NoClassDefFoundError after compiled into executable · Issue #566 · joeferner/node-java

X Title: java.lang.NoClassDefFoundError after compiled into executable · Issue #566 · joeferner/node-java

Description: i tried to make a small node js calling jar file that function to call hello world it works normall if i just run node test.js. but if i build the package into .exe using pkg method it gives out this error can someone help me? var clazz ...

Open Graph Description: i tried to make a small node js calling jar file that function to call hello world it works normall if i just run node test.js. but if i build the package into .exe using pkg method it gives out th...

X Description: i tried to make a small node js calling jar file that function to call hello world it works normall if i just run node test.js. but if i build the package into .exe using pkg method it gives out th...

Opengraph URL: https://github.com/joeferner/node-java/issues/566

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"java.lang.NoClassDefFoundError after compiled into executable","articleBody":"i tried to make a small node js calling jar file that function to call hello world it works normall if i just run node test.js. but if i build the package into .exe using pkg method it gives out this error can someone help me?\r\n```\r\nvar clazz = java.findClassSync(name); // TODO: change to Class.forName when classloader issue is resolved.\r\n                   ^\r\n\r\nError: Could not create class Test\r\njava.lang.NoClassDefFoundError: Test\r\nCaused by: java.lang.ClassNotFoundException: Test\r\n        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)\r\n        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)\r\n        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)\r\n\r\n    at Java.import (C:\\snapshot\\test-node-java\\node_modules\\←[4mjava←[24m\\lib\\nodeJavaBridge.js:227:20)\r\n    at Object.\u003canonymous> (C:\\snapshot\\test-node-java\\test.js:4:23)\r\n    at Module._compile (pkg/prelude/bootstrap.js:1930:22)\r\n←[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)←[39m\r\n←[90m    at Module.load (node:internal/modules/cjs/loader:981:32)←[39m\r\n←[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m\r\n    at Function.runMain (pkg/prelude/bootstrap.js:1983:12)\r\n←[90m    at node:internal/main/run_main_module:17:47←[39m {\r\n  cause: nodeJava_java_lang_NoClassDefFoundError {}\r\n}\r\n```\r\nthis is the js code\r\n```\r\nvar java = require('java');\r\n\r\njava.classpath.push('test-node-java.jar');\r\nlet test = java.import('Test');\r\ntest.hello();\r\nconsole.log(test)\r\n```\r\nthis is the java code\r\n```\r\nimport java.lang.System;\r\n\r\npublic class Test {\r\n    public static void hello() {\r\n        System.out.println(\"Hello Java\");\r\n    }\r\n    public static void main(String[] args) {\r\n        System.out.println(\"Hello, world!\");\r\n    }\r\n}\r\n```\r\nthis is the package.json\r\n```\r\n{\r\n  \"name\": \"test-node-java\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"\",\r\n  \"main\": \"index.js\",\r\n  \"bin\": \"test.js\",\r\n  \"scripts\": {\r\n    \"start\": \"node test.js\",\r\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\r\n    \"build\": \"pkg . --target node16-win-x64\"\r\n  },\r\n  \"author\": \"\",\r\n  \"license\": \"ISC\",\r\n  \"dependencies\": {\r\n    \"java\": \"^0.12.2\",\r\n    \"java-caller\": \"^2.7.0\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"pkg\": \"^5.8.0\"\r\n  },\r\n  \"pkg\": {\r\n    \"outputPath\": \".dist\",\r\n    \"assets\": [\r\n      \"./node_modules/**/*\"\r\n    ]\r\n  }\r\n}\r\n```\r\nall the files are under the same directory including the test-node-java.jar","author":{"url":"https://github.com/Y-christian","@type":"Person","name":"Y-christian"},"datePublished":"2023-01-05T09:46:00Z","url":"https://github.com/joeferner/node-java/issues/566"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:38c2cd81-e76f-296f-d5d2-bae0b3653d72
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCC4:27FCA3:1CA5506:27F115E:6AFD0C9C
html-safe-nonce121cf7f8e1eae3425328d21a853fdd01cdb89386f8ad2baefdc98e89ce806a5c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0M0OjI3RkNBMzoxQ0E1NTA2OjI3RjExNUU6NkFGRDBDOUMiLCJ2aXNpdG9yX2lkIjoiODk5NjkyNjUwNjUxMjc0NzY3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac694c7a8fe91f3e4f2b56d70ebd37f40348e9d98433031cb322a6a962dbc7ceab
hovercard-subject-tagissue:1520426280
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/joeferner/node-java/566/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2d83db4671c783ecc1e909bbdee4166bb018d2a9642d1e5da387d79b48c33646/joeferner/node-java/issues/566
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2d83db4671c783ecc1e909bbdee4166bb018d2a9642d1e5da387d79b48c33646/joeferner/node-java/issues/566
og:image:alti tried to make a small node js calling jar file that function to call hello world it works normall if i just run node test.js. but if i build the package into .exe using pkg method it gives out th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameY-christian
hostnamegithub.com
expected-hostnamegithub.com
Noneb29de2abb97b6307b16270785efeb58b51a117d5a9b659acf00b77aa00e7043b
turbo-cache-controlno-preview
go-importgithub.com/joeferner/node-java git https://github.com/joeferner/node-java.git
octolytics-dimension-user_id808857
octolytics-dimension-user_loginjoeferner
octolytics-dimension-repository_id3228734
octolytics-dimension-repository_nwojoeferner/node-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3228734
octolytics-dimension-repository_network_root_nwojoeferner/node-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c9e619def6d670dc18a45d3b02cea938c1c7e47
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/joeferner/node-java/issues/566#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjoeferner%2Fnode-java%2Fissues%2F566
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjoeferner%2Fnode-java%2Fissues%2F566
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=joeferner%2Fnode-java
Reloadhttps://github.com/joeferner/node-java/issues/566
Reloadhttps://github.com/joeferner/node-java/issues/566
Reloadhttps://github.com/joeferner/node-java/issues/566
joefernerhttps://github.com/joeferner
node-javahttps://github.com/joeferner/node-java
Codehttps://github.com/joeferner/node-java
Issues208 (208)https://github.com/joeferner/node-java/issues
Pull requests2 (2)https://github.com/joeferner/node-java/pulls
Actionshttps://github.com/joeferner/node-java/actions
Projectshttps://github.com/joeferner/node-java/projects
Wikihttps://github.com/joeferner/node-java/wiki
Security and qualityhttps://github.com/joeferner/node-java/security
Insightshttps://github.com/joeferner/node-java/pulse
https://github.com/joeferner/node-java
New issuehttps://github.com/login?return_to=https://github.com/joeferner/node-java/issues/566
New issuehttps://github.com/login?return_to=https://github.com/joeferner/node-java/issues/566
java.lang.NoClassDefFoundError after compiled into executablehttps://github.com/joeferner/node-java/issues/566#top
https://github.com/Y-christian
Y-christianhttps://github.com/Y-christian
on Jan 5, 2023https://github.com/joeferner/node-java/issues/566#issue-1520426280
Y-christianhttps://github.com/Y-christian
on Jan 5, 2023https://github.com/joeferner/node-java/issues/566#event-8158608468
https://github.com/velara3
velara3https://github.com/velara3
on May 1, 2024https://github.com/joeferner/node-java/issues/566#issuecomment-2087775373
Sign up for freehttps://github.com/signup?return_to=https://github.com/joeferner/node-java/issues/566
Sign in to commenthttps://github.com/login?return_to=https://github.com/joeferner/node-java/issues/566
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.