From 041c10c83bf3a264477a6d9f8fdc08b16b918a87 Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Sat, 28 Oct 2023 06:06:37 -0700 Subject: [PATCH] fix: Generate native interfaces not working on windows See https://github.com/codenameone/CodenameOne/issues/3756 --- .../java/com/codename1/maven/GenerateNativeInterfaces.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/GenerateNativeInterfaces.java b/maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/GenerateNativeInterfaces.java index 6a85e48717..a5a8ee32a7 100644 --- a/maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/GenerateNativeInterfaces.java +++ b/maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/GenerateNativeInterfaces.java @@ -81,7 +81,10 @@ private void generateNativeInterface(String relativePath) throws Exception { URLClassLoader cl = new URLClassLoader(new URL[]{ new File(project.getBuild().getOutputDirectory()).toURI().toURL(), cn1CoreJar.toURI().toURL()}); - String classPath = relativePath.replace(File.separator, "."); + String classPath = relativePath + .replace("\\", ".") + .replace("/", ".") + .replace(File.separator, "."); classPath = classPath.substring(0, classPath.lastIndexOf(".")); c = cl.loadClass(classPath);