Here you can find the source of getJDKPath(File file)
private static String getJDKPath(File file)
//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()); } } }