graalvm 2024-06-24

Did anyone try docjure with GraalVM? I've faced a situation when I need to produce an Excel file (instead of CSV as before), and I'm getting plenty of errors when compiling the uberjar. Just interesting if someone has already gone through that path.

Perhaps reflection issues?

Not really, I've checked my namespaces for reflections. I've got many errors like >

sun.awt.UNIXToolkit the class was requested to be initialized at run time
and there are plenty of http://sun.awt.XXX classes

I already have this in the arguments to native image

--initialize-at-run-time=sun.awt

the issue might be that the clojure library initializes something at the top level which should be done in a delay or function

I've gone through its source code, there is a single file and I see only functions and multimethods: https://github.com/mjul/docjure/blob/master/src/dk/ative/docjure/spreadsheet.clj

docjure depends on poi, have you added any config for that? Or run the agent?

No I haven't done any of these. Honestly, I haven't been doing any graalvm compilation for a long time and forgot it a little

Could you point me to the right direction? What config do you mean?

Personally I'm thinking about trying org.dhatim/fastexcel, it's a small lib for Excel which might work with graal without all that workarounds.

POI is a monstrosity in fact

Sure, good idea

the very idea of sun.aws.* classes being used somewhere deep inside POI brings cold sweat

Quick update: fastexcel and fastexcel-reader worked fine, both compiled by GraalVM with no issues

🎉 2

Anyone has experience running com.nilenso/goose on graal? = does it need serious tweaking to work or just runs out of the box?