Java JDK Home Get getJDKPath(File file)

Here you can find the source of getJDKPath(File file)

Description

get JDK Path

License

Open Source License

Declaration

private static String getJDKPath(File file) 

Method Source Code


//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.io.File;

public class Main {
    private static String getJDKPath(File file) {
        if (file == null) {
            return null;
        }/*from w w  w.j a  v  a2  s . co m*/
        if ("bin".equals(file.getName())) {//$NON-NLS-1$
            return file.getParent();
        } else {
            return getJDKPath(file.getParentFile());
        }
    }
}

Related

  1. getJdkBin()
  2. getJdkHome()
  3. getJdkHome()
  4. getJDKHomeVariable()