Mike Warren
Mike Warren

Reputation: 3866

Are JAR files machine dependent

I am making a math reflexes game in Java using the Eclipse Juno IDE. From the research I have already done, the IDE compiles everything into .class files bytecode upon save! The problem now is that I have tried extracting everything to JAR from a Windows machine, and giving the JAR to some beta-testers. The beta-testers reported problems upon trying to access it from a Linux/Mac. I also know already that a runnable JAR what I was extracting everything to is basically a glorified ZIP compressed file containing the bytecode that the JVM understands and executes. Given that my game has multiple .java files, I would like to know if:

  1. the packaging of the bytecode into a JAR is machine-dependent

  2. my options to ensure that ALL USERS are able to play my game //and reap the benefits; it is also worth pointing out that my computer does not have javac.exe; that program is reported outdated by Sun Microsystems

    System.out.println("Thanks for your patience in advance!");
    

Upvotes: 1

Views: 2202

Answers (2)

Mike Warren
Mike Warren

Reputation: 3866

Found out that Mac computers are only running Java 6 //and I might be using code exclusive to Java 7

Upvotes: 0

bsiamionau
bsiamionau

Reputation: 8229

  1. Java bytecode is fully platform-independent
  2. Everybody who has rights to run JVM can play your game

From official platform-overview:

The Java virtual machine is an abstract computing machine that has an instruction set and manipulates memory at run time. The Java virtual machine is ported to different platforms to provide hardware- and operating system-independence.

Upvotes: 5

Related Questions