Esempio n. 1
0
 /**
  * Returns the java executable for this VM or <code>null</code> if cannot be found
  *
  * @return executable for this VM or <code>null</code> if none
  */
 File getJavaExecutable() {
   File installLocation = getInstallLocation();
   if (installLocation != null) {
     return StandardVMType.findJavaExecutable(installLocation);
   }
   return null;
 }
Esempio n. 2
0
 /* (non-Javadoc)
  * @see org.eclipse.jdt.launching.IVMInstall#getJavaVersion()
  */
 public String getJavaVersion() {
   StandardVMType installType = (StandardVMType) getVMInstallType();
   File installLocation = getInstallLocation();
   if (installLocation != null) {
     File executable = getJavaExecutable();
     if (executable != null) {
       String vmVersion = installType.getVMVersion(installLocation, executable);
       // strip off extra info
       StringBuffer version = new StringBuffer();
       for (int i = 0; i < vmVersion.length(); i++) {
         char ch = vmVersion.charAt(i);
         if (Character.isDigit(ch) || ch == '.') {
           version.append(ch);
         } else {
           break;
         }
       }
       if (version.length() > 0) {
         return version.toString();
       }
     }
   }
   return null;
 }