File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,21 @@ public String getJavaVersion() {
5858 File executable = getJavaExecutable ();
5959 if (executable != null ) {
6060 String vmVersion = installType .getVMVersion (installLocation , executable );
61- // strip off extra info
6261 StringBuilder version = new StringBuilder ();
63- for (int i = 0 ; i < vmVersion .length (); i ++) {
62+ loop : for (int i = 0 ; i < vmVersion .length (); i ++) {
6463 char ch = vmVersion .charAt (i );
65- if (Character .isDigit (ch ) || ch == '.' ) {
66- version .append (ch );
67- } else {
68- break ;
64+ switch (ch ) {
65+ case '.' :
66+ case '_' :
67+ case '-' :
68+ version .append (ch );
69+ break ;
70+ default :
71+ if (Character .isDigit (ch )) {
72+ version .append (ch );
73+ break ;
74+ }
75+ break loop ;
6976 }
7077 }
7178 if (version .length () > 0 ) {
You can’t perform that action at this time.
0 commit comments