Most of Tomcat uses File.separator, but there are a few instances of System.getProperty("file.separator") The two can be different, but still allow the JVM to start up. I found the following worked: java -Dfile.separator=/xyz for Unix or the equivalent \xyz on Windows. Using a different first character does not work - the JVM usually throws an exception as it cannot find some required files if the sep. is incorrect. It looks like only the first character of the property is used by the JVM. However, this is not done by the application code I have seen, which means that there could be a discrepancy between the two methods. File.separator has the additional benefit that it is not subject to a privilege check.
I have a patch for trunk [1] that I'll commit once svn writes are available again. Then I'll look at back-ports. [1] https://github.com/markt-asf/tomcat/commit/0744a45a939311cc0ac0981a6922e4afd1e2e7d4
(In reply to Mark Thomas from comment #1) > I have a patch for trunk [1] that I'll commit once svn writes are available > again. Then I'll look at back-ports. > > [1] > https://github.com/markt-asf/tomcat/commit/ > 0744a45a939311cc0ac0981a6922e4afd1e2e7d4 That would fix the instances I found.
It looks like the same applies to "path.separator" and File.pathSeparator. i.e. changing the property causes issues for startup, and only the first char is used by Java. If so, here are the instances I found in trunk: java/org/apache/jasper/compiler/AntCompiler.java: String sep = System.getProperty("path.separator"); java/org/apache/jasper/compiler/JspRuntimeContext.java: String sep = System.getProperty("path.separator"); java/org/apache/tomcat/jni/Library.java: String sep = System.getProperty("path.separator"); test/org/apache/juli/TestClassLoaderLogManager.java: + System.getProperty("path.separator") test/org/apache/juli/TestClassLoaderLogManager.java: + System.getProperty("path.separator") + "baz", test/org/apache/juli/TestClassLoaderLogManager.java: Assert.assertEquals("${}" + System.getProperty("path.separator"),
Fixed in trunk, 8.0.x (for 8.0.16 onwards) and 7.0.x (for 7.0.58 onwards).