are there any things that once can do ignorantly that can prevent a java web application from being cross platform? (windows/linux/mac)
Tools I am planning to use are java/spring framework/hibernate
- Hard-coding file separators/paths.
- Using native libraries.
- Using Runtime.exec()
- Using sun.* classes (this may cause portability issues with non-Sun JVMs).
not honoring case-sensitivity in filesystem
Using system default character encoding for input/output when inappropriate
In addition to what Dan Dyer said:
- calling executables by a fixed path or of a fixed name
- assuming a certain shell command syntax will work properly (eg
2>&1
or something) - deleting or renaming a file that some other process (or the same one!) might have open
- Making assumptions about the working directory (eg using relative paths to load resouces from the file system)
精彩评论