Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalPlantUmlRenderer is not works on non-Windows environment #33

Open
filzrev opened this issue Nov 30, 2024 · 0 comments
Open

LocalPlantUmlRenderer is not works on non-Windows environment #33

filzrev opened this issue Nov 30, 2024 · 0 comments

Comments

@filzrev
Copy link

filzrev commented Nov 30, 2024

On Ubuntu environment.

PlantUml.Net failed to resolve Java executable path.
It occurred when running PlantUml.Net with RenderingMode = RenderingMode.Local.

It's seems to be caused because EnvironmentJavaLocator::GetJavaInstallationPath methods assuming executable name as java.exe.
(On non-Windows environment. It need to specify without .exe extension)

Additionally, when specifying java executable path with JavaPath settings explicitly.
Process hanged at LocalPlantUmlRenderer::RenderAsync method on Ubuntu OS.

Code to reproduce problems

internal class Program
{
    static async Task Main(string[] args)
    {
        var factory = new RendererFactory();

        var renderer = factory.CreateRenderer(new PlantUmlSettings
        {
            JavaPath = "/usr/bin/java",
            ErrorReportMode = ErrorReportMode.Verbose,
            RenderingMode = RenderingMode.Local,
        });

        var bytes = await renderer.RenderAsync("Bob -> Alice : Hello", OutputFormat.Png);
        File.WriteAllBytes("out.png", bytes);
    }
}

See: dotnet/docfx#10435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant