Skip to content

Commit d032218

Browse files
author
HongKee Moon
committed
Fixed that windows has an issue for generating a jar file
1 parent fbe3b98 commit d032218

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/spim/plugin/compile/IOUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void createJar(String inputDir, String output) throws IOException {
156156
Manifest manifest = new Manifest();
157157
manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
158158
JarOutputStream target = new JarOutputStream(new FileOutputStream(output), manifest);
159-
addFileJar(inputDir, new File(inputDir), target);
159+
addFileJar(inputDir.replace("\\", "/"), new File(inputDir), target);
160160
target.close();
161161
}
162162

@@ -167,7 +167,7 @@ private static void addFileJar(String root, File source, JarOutputStream target)
167167
{
168168
if (source.isDirectory())
169169
{
170-
String name = source.getPath().replace(root, "").replace("\\", "/");
170+
String name = source.getPath().replace("\\", "/").replace(root, "");
171171
if (!name.isEmpty())
172172
{
173173
if (!name.endsWith("/"))
@@ -182,7 +182,7 @@ private static void addFileJar(String root, File source, JarOutputStream target)
182182
return;
183183
}
184184

185-
JarEntry entry = new JarEntry(source.getPath().replace(root, "").replace("\\", "/"));
185+
JarEntry entry = new JarEntry(source.getPath().replace("\\", "/").replace(root, ""));
186186
entry.setTime(source.lastModified());
187187
target.putNextEntry(entry);
188188
in = new BufferedInputStream(new FileInputStream(source));

0 commit comments

Comments
 (0)