Skip to content

Commit de3be54

Browse files
committed
Fix java executable extension in macOS
1 parent 10e94f0 commit de3be54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Editor/GradleWrapperGenerator.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ public static string FindJavaExecutable()
6868
#else
6969
string javaRoot = Path.Combine(GetUnityAndroidPlayerRoot(), "OpenJDK");
7070
#endif
71-
string javaExe = Path.Combine(javaRoot, "bin", "java" + Path.GetExtension(EditorApplication.applicationPath));
71+
#if UNITY_EDITOR_WIN
72+
string javaExe = Path.Combine(javaRoot, "bin", "java.exe");
73+
#else
74+
string javaExe = Path.Combine(javaRoot, "bin", "java");
75+
#endif
7276
if (File.Exists(javaExe))
7377
{
7478
return javaExe;

0 commit comments

Comments
 (0)