Changeset 5725


Ignore:
Timestamp:
12/02/09 11:15:02 (10 years ago)
Author:
curtis
Message:

Generalize 64-bit JVM detection for QTJava (also a problem with Win64).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/gui/LegacyQTTools.java

    r5585 r5725  
    5656    "Please install QuickTime for Java from http://www.apple.com/quicktime/"; 
    5757 
    58   public static final String MAC_64BIT_JVM_MSG = 
    59     "QuickTime for Java is not supported on Mac OS X with a 64-bit JVM. " + 
    60     "Please invoke the 32-bit JVM to utilize QTJava functionality."; 
     58  public static final String JVM_64BIT_MSG = 
     59    "QuickTime for Java is not supported with a 64-bit JVM. " + 
     60    "Please invoke the 32-bit JVM (-d32) to utilize QTJava functionality."; 
    6161 
    6262  public static final String EXPIRED_QT_MSG = 
     
    120120  protected boolean noQT = false; 
    121121 
    122   /** Flag indicating Mac OS X 64-bit JVM (does not support QTJava). */ 
    123   protected boolean mac64BitJVM = false; 
     122  /** Flag indicating 64-bit JVM (does not support QTJava). */ 
     123  protected boolean jvm64Bit = false; 
    124124 
    125125  /** Flag indicating QuickTime for Java has expired. */ 
     
    135135    if (initialized) return; 
    136136 
    137     String os = System.getProperty("os.name"); 
    138137    String arch = System.getProperty("os.arch"); 
    139     if ("Mac OS X".equals(os) && "x86_64".equals(arch)) { 
    140       // QTJava is not supported on Mac OS X 64-bit Java; don't even try 
     138    if (arch != null && arch.indexOf("64") >= 0) { 
     139      // QTJava is not supported on 64-bit Java; don't even try 
    141140      noQT = true; 
    142       mac64BitJVM = true; 
     141      jvm64Bit = true; 
    143142      initialized = true; 
    144143      return; 
     
    205204  } 
    206205 
    207   /** Whether this JVM is 64-bit running on Mac OS X. */ 
    208   public boolean isMac64BitJVM() { 
     206  /** Whether this JVM is 64-bit. */ 
     207  public boolean isJVM64Bit() { 
    209208    if (!initialized) initClass(); 
    210     return mac64BitJVM; 
     209    return jvm64Bit; 
    211210  } 
    212211 
     
    219218  /** Gets the QuickTime for Java version number. */ 
    220219  public String getQTVersion() { 
    221     if (isMac64BitJVM()) return "Not available"; 
     220    if (isJVM64Bit()) return "Not available"; 
    222221    else if (isQTExpired()) return "Expired"; 
    223222    else if (!canDoQT()) return "Missing"; 
     
    317316  /** Checks whether QTJava is available, throwing an exception if not. */ 
    318317  public void checkQTLibrary() throws MissingLibraryException { 
    319     if (isMac64BitJVM()) throw new MissingLibraryException(MAC_64BIT_JVM_MSG); 
     318    if (isJVM64Bit()) throw new MissingLibraryException(JVM_64BIT_MSG); 
    320319    if (isQTExpired()) throw new MissingLibraryException(EXPIRED_QT_MSG); 
    321320    if (!canDoQT()) throw new MissingLibraryException(NO_QT_MSG); 
Note: See TracChangeset for help on using the changeset viewer.