• Post Reply Bookmark Topic Watch Topic
  • New Topic

Divergence between Java for Windows and Java for Linux  RSS feed

 
Theo Miller
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been finding more and more discrepancies between java 1.7 for windows and 1.7 for Linux. For example, 1.7 linux does not have Files.ReadAllBytes(Path path) (gives a no such method compiler error). Nor does the 1.7 linux all the use of "||" in a catch to to run multiple exceptions through the sane code.

Does anyone know if the the divergence is permanent and how large it will get?

Regards

Theo.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Theo Miller wrote:I have been finding more and more discrepancies between java 1.7 for windows and 1.7 for Linux. For example, 1.7 linux does not have Files.ReadAllBytes(Path path) (gives a no such method compiler error). Nor does the 1.7 linux all the use of "||" in a catch to to run multiple exceptions through the sane code.

If you see these kind of errors, they are not because of differences between Java 7 for Windows and Java 7 for Linux. Something must be wrong with your setup on either your Windows or your Linux system. It sounds like you're using Java 6 instead of 7 on the system where you're missing those things. Check which Java version is really being used. If you're using Eclipse, check if your compiler compliance settings are really set to Java 7.

There are no differences in the API between Java 7 for different operating systems.

There's no method called Files.ReadAllBytes in Java 7. There is, however, a method called readAllBytes in class java.nio.file.Files.
 
Monica Shiralkar
Ranch Hand
Posts: 922
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I do not wish to move away from the direction of the thread but I am curious to know that when there is slight difference between Java for Windows and Java for Linux then why do we say Java is platform independent?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Monica. Shiralkar wrote:when there is slight difference between Java for Windows and Java for Linux ...

As Jesper pointed out, there isn't a difference.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!