question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello world in Clojure

See original GitHub issue

This is an amazing project. Thank you for sharing this with the world.

I’ve tried to compile a hello world program with Clojure, and encountered an issue that comes up when Clojure itself is being compiled.

[ERROR] Failed to execute goal de.mirkosertic.bytecoder:bytecoder-mavenplugin:2020-07-29:compile (default) on project bar: Error running bytecoder: Error linking class bar.core: Error linking class clojure.lang.RT: Error linking class clojure.lang.Compiler: Error linking class clojure.lang.Reflector: Cannot find static method lookup in java/lang/invoke/MethodHandles with signature java.lang.invoke.MethodHandles$Lookup() -> [Help 1]

It is an issue that also came up previously when people tried to use the Graal native image on Clojure code. The good news is that the fix is known, the bad news is that the latter is enabled by a GraalVM feature called substitutions.

The comprehensive description + fix was submitted by @borkdude and I’ll cite the reference here: https://github.com/oracle/graal/issues/2214

It would be awesome if we could get past this hurdle and compile Clojure to wasm. Thank you in all cases!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danielszcommented, Aug 13, 2020

Totally makes sense. Thank you for doing the research and sharing this with us. Yours is an awesome project regardless.

1reaction
borkdudecommented, Aug 10, 2020

The substitutions are only needed for Java 11. An alternative approach is to copy clojure.lang.Reflector.java into your own project and patch accordingly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clojure - Basic Syntax - Tutorialspoint
Write 'Hello world' in a complete Clojure program. ... In our Clojure code, we are using the 'println' statement to print “Hello World”...
Read more >
Hello World - ClojureBridge London
Hello World. This is always the first tiny baby step when learning a programming language. Let's try “Hello, World!” in Clojure.
Read more >
Hello world in Clojure (Example) - Coderwall
Firstly, Download & Install leiningen - which will help you build your Clojure project. Create a new project using leiningen's lein command:
Read more >
clojure-by-example/helloworld.md at master - GitHub
Clojure is a great programming language for prototyping. It's allows you to run code in an interactive console for quick feedback. This console...
Read more >
Hello World · Practicalli Clojurescript
Hello World. Create a new file called src/hello_world/core.cljs and add the following code: (ns hello-world.core) (enable-console-print!) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found