Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/J2NET/Utilities/PathUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ public static class PathUtility
{
public static string GetRuntimePath()
{
string javaHome = Environment.GetEnvironmentVariable("java_home");

if (javaHome != null)
{
return Path.Combine(javaHome, "bin", "java");
}

var directory = Path.GetDirectoryName(typeof(PathUtility).Assembly.Location) ?? throw new DirectoryNotFoundException();
var runtimeIdentifier = GetRuntimeIdentifier();
return Path.Combine(directory, "runtimes", runtimeIdentifier, "openjre", "bin", "java");
Expand Down