---
title: "简单判断所选目录是否是jre_home"
author: "annewman"
date: "2010-06-25T15:56:26Z"
tags: []
categories: ["编程语言"]
slug: "jre-home"
draft: false
lastmod: "2010-06-25T15:56:26Z"
id: 699318
url: "https://annewman.iteye.com/blog/699318"
---

```
public static boolean isValidJre(String path) {
		File jre = new File(path);
		if (!jre.exists())
			return false;

		File javaExe = StandardVMType.findJavaExecutable(jre);
		return (javaExe != null && javaExe.exists());
	}
```