简体   繁体   English

JAR文件是否与机器相关

[英]Are JAR files machine dependent

I am making a math reflexes game in Java using the Eclipse Juno IDE. 我正在使用Eclipse Juno IDE用Java编写数学反射游戏。 From the research I have already done, the IDE compiles everything into .class files bytecode upon save! 根据我已经完成的研究,IDE在保存时将所有内容编译为.class文件字节码 The problem now is that I have tried extracting everything to JAR from a Windows machine , and giving the JAR to some beta-testers. 现在的问题是,我尝试从Windows机器中将所有内容提取到JAR中,并将该JAR提供给某些beta测试人员。 The beta-testers reported problems upon trying to access it from a Linux/Mac. Beta测试人员报告了尝试从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. 我也已经知道,将所有内容提取到的可运行JAR基本上是一个美化的ZIP 压缩文件,其中包含JVM能够理解和执行的字节码。 Given that my game has multiple .java files, I would like to know if: 鉴于我的游戏有多个.java文件,我想知道是否:

  1. the packaging of the bytecode into a JAR is machine-dependent 字节码到JAR的包装是与机器有关的

  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; 还值得指出的是,我的计算机没有javac.exe; that program is reported outdated by Sun Microsystems 该程序被Sun Microsystems报告为过时的

     System.out.println("Thanks for your patience in advance!"); 
  1. Java bytecode is fully platform-independent Java字节码完全独立于平台
  2. Everybody who has rights to run JVM can play your game 每个有权运行JVM的人都可以玩你的游戏

From official platform-overview : 从官方平台概览

The Java virtual machine is an abstract computing machine that has an instruction set and manipulates memory at run time. Java虚拟机是具有指令集并在运行时操作内存的抽象计算机。 The Java virtual machine is ported to different platforms to provide hardware- and operating system-independence. Java虚拟机已移植到不同的平台,以提供与硬件和操作系统无关的功能。

发现Mac计算机仅运行Java 6 // //我可能正在使用Java 7专有的代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM