Closed lemonlion closed 10 months ago
Looks like this goes into AWT, which we don't currently support.
@wasabii Ah ok - thanks for your reply. Is there any workaround at all that you could suggest?
Nope. Not as it stands currently. There's probably a possibility of getting headless mode working, but I'm just not sure what that requires right now.
Closing since duplicate.
@lemonlion plantuml works not with IKVM 8.9.1 https://github.com/ikvmnet/ikvm/releases/tag/8.9.1
I am attempting to run the PlantUml Jar on IKVM, but it seems to just fail with a System.TypeInitializationException
To aid anyone who want to try help fixing the issue I have created a public repository of the code https://github.com/lemonlion/PlantUmlIkvmTest
First I went to https://plantuml.com/download and downloaded the latest MIT licensed version (
plantuml-mit-1.2023.13.jar
). I then created a new C# .Net 6 console project namedPlantUmlIkvm
and added a new folder calledPlantUml
and put the jar in there.Next I installed all the packages mentioned in the IKVM Readme and I also installed
IKVM.Maven.Sdk
Next I added an IkvmReference tag in my project file as per the IKVM readme. I also put Debug true to allow for any debugging functionality.
At this point the entire solution looks like this:
I then rebuilt the entire solution. I look in
C:/Code/PlantUmlIkvm/bin/Debug/net6.0
and am pleased to see that a dll has been created callednet.sourceforge.plantuml.dll
indicating that IKVM has successfully translated the jar into something .net compatible.I then attempt to use PlantUml from my solution. Besides some intellisense weirdness (the IDE isn't always recognising the classes as classes), the new classes appear to be picked up by visual studio and I can decompile into them using Visual Studio/Resharper. I follow the PlantUml tutorial from their main page for creating a PNG image from some basic plantUml and so I enter the following code into the main Program.cs:
The program builds successfully. It runs successfully up to a point, but fails on this line:
var desc = reader.outputImage(png).getDescription();
The line fails with message
System.TypeInitializationException: 'The type initializer for 'net.sourceforge.plantuml.FileFormat' threw an exception.'
Outer Exception TargetSite:
Inner Exception TargetSite:
The main Stack Trace:
The inner exception Stack Trace:
I believe the error is happening when it tries to create a FileFormatOption, hence when I insert this additional line it fails there first:
I am running all this on Windows 10.
I imagine this is more of an IKVM issue than a PlantUml issue, but open to any ideas. Although the IKVM Readme is a good baseline, I can't see any real world examples there so difficult to know if I'm using IKVM correctly or not.