-3

What are the cross-platform development principles in java? What problems are waiting me? I want to create cross-platform file manager (java se).

  • cross-platform means an application can run on any Operating System. – Anand Sep 15 '12 at 09:13
  • 1
    possible duplicate of [Is Java cross platform?](http://stackoverflow.com/questions/5978005/is-java-cross-platform) – assylias Sep 15 '12 at 09:14
  • 1
    Pretty much everything in Java is cross-platform, however certain areas of code (File handling, GUI, devices etc.) are a little tricky in terms of portability! I suggest you start writing code and face problems as soon as they arise... – Angelos Chalaris Sep 15 '12 at 09:18

2 Answers2

2

Technically Java only runs on one platform, the JVM. What you may have in mind is a cross operating system application. The most basic challenge is handling / and \ correctly.

However, the biggest problem you are likely to face is in the GUI providing a windows friendly interface on windows, mac friendly on mac and linux friendly on linux. This is an interface design issue rather than a coding issue.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
0

You can get lots of articles on platform independency of java. Check this Oracle Documentiation on how java works.

You can go through this post how-is-java-platform-independent also.

So the key thing to keep in mind avoid doing platform specific things in your javacode

  1. Do not execute OS Specific commands or scripts(you may be tempted to do that for things like checking disk space, but java has platform idependant implementation for that)
  2. Avoid direclty depending OS variables(gettting home dir etc)
Community
  • 1
  • 1
basiljames
  • 4,777
  • 4
  • 24
  • 41