diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java index cec9e5191..3ec1a5063 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java @@ -1,3 +1,4 @@ + /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Konloch - Konloch.com / BytecodeViewer.com * @@ -20,6 +21,7 @@ import java.io.File; import java.io.PrintStream; +import java.nio.file.FileSystems; import org.objectweb.asm.Opcodes; import the.bytecode.club.bytecodeviewer.resources.ResourceType; @@ -66,8 +68,8 @@ public class Constants //if true the version checker will prompt and ask how you would like to proceed public static final boolean FORCE_VERSION_CHECKER_PROMPT = false; - public static final String fs = System.getProperty("file.separator"); - public static final String nl = System.getProperty("line.separator"); + public static final String fs = FileSystems.getDefault().getSeparator(); + public static final String nl = System.lineSeparator(); public static final File BCVDir = resolveBCVRoot(); public static final File RT_JAR = new File(System.getProperty("java.home") + fs + "lib" + fs + "rt.jar"); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java index 8abb9d5c7..0897751d8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java @@ -88,7 +88,7 @@ public byte[] compile(String contents, String fullyQualifiedName) Configuration.javac, "-d", fileStart2, "-classpath", - cp.getAbsolutePath() + System.getProperty("path.separator") + Configuration.library, + cp.getAbsolutePath() + File.pathSeparator + Configuration.library, java.getAbsolutePath() ); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java index cb4e9ca35..4ef07d9a1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java @@ -379,7 +379,7 @@ public String readProcess(Process process) throws IOException while ((line = reader.readLine()) != null) { builder.append(line); - builder.append(System.getProperty("line.separator")); + builder.append(System.lineSeparator()); } return builder.toString(); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/NewlineOutputStream.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/NewlineOutputStream.java index fa0d97a8c..f21c8b61e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/NewlineOutputStream.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/NewlineOutputStream.java @@ -38,7 +38,7 @@ public class NewlineOutputStream extends FilterOutputStream { public NewlineOutputStream(OutputStream os) { super(os); if (newline == null) { - String s = System.getProperty("line.separator"); + String s = System.lineSeparator(); if (s == null || s.length() <= 0) s = "\n"; newline = s.getBytes(StandardCharsets.ISO_8859_1); // really us-ascii