---
title: "JAVA Exception"
author: "bd2007"
date: "2011-08-10T16:41:43Z"
tags: []
categories: ["编程语言"]
slug: "java-exception"
draft: false
lastmod: "2011-08-10T16:41:43Z"
id: 1144833
url: "https://bd2007.iteye.com/blog/1144833"
---

1.报错如下：
   <span style="color: #ff0000;">java.io.filenotfoundexception: d: (拒绝访问。)</span>
   解决：在设置file file=new file(str); str的时候需要把str精确掉某个文件。例如str="d:"是错误的,应该是<span style="white-space: pre;">	</span>       <span style="white-space: pre;">	</span>str="d:\\a.txt"