String javaHome = System.getProperty("java.home");您可以通过Windows上的纯Java告诉我吗?如何找到javaw.exe的位置?
例如
import java.io.File;class JavawLocation { public static void main(String[] args) { String javaHome = System.getProperty("java.home"); File f = new File(javaHome); f = new File(f, "bin"); f = new File(f, "javaw.exe"); System.out.println(f + " exists: " + f.exists()); }}输出量
C:Program Files (x86)Javajdk1.6.0_29jrebinjavaw.exe exists: truePress any key to continue . . .
是的,我有信心可以在JRE中使用。



