2010-07-13 87 views

回答

3
import org.netbeans.api.autoupdate.UpdateElement; 
import org.netbeans.api.autoupdate.UpdateManager; 
import org.netbeans.api.autoupdate.UpdateUnit; 

public class VersionUtil { 

    public static String getVersion(String codename) { 
    for (UpdateUnit updateUnit : UpdateManager.getDefault().getUpdateUnits()) { 
     UpdateElement updateElement = updateUnit.getInstalled(); 
     if (updateElement != null) 
     if (codename.equals(updateElement.getCodeName())) 
      return updateElement.getSpecificationVersion(); 
    } 

    return "unknown"; 
    } 
} 
+0

我該如何找到NetBeans平臺的版本? – Aguid 2018-02-05 14:30:48

+0

嗯..我忘了,對不起。這個問題在7年前問過。 – Vincent 2018-02-06 00:32:04