---
title: "解决com.sun.tools.javac.Main is not on the classpath的问题"
author: "Freeze"
date: "2010-07-26T15:24:20Z"
tags: []
categories: ["编程语言"]
slug: "com-sun-tools-javac-main-is-not-on-the-classpath"
draft: false
lastmod: "2010-07-26T15:24:20Z"
id: 721470
url: "https://freeze.iteye.com/blog/721470"
---

本文来自CSDN博客，转载请标明出处：

[http://blog.csdn.net/lhjlhj123123/archive/2010/05/19/5607106.aspx](http://blog.csdn.net/lhjlhj123123/archive/2010/05/19/5607106.aspx)

--------------------------转载分割线------------------------------------

 

 

在重装了JDk之后，有可能会使Eclipse在编译工程的时候出现如下错误：

 

com.sun.tools.javac.Main is not on the classpath.  
Perhaps JAVA\_HOME does not point to the JDK.  
It is currently set to "C:\\Program Files\\Java\\jre1.5.0\_11"

 

遇到这种情况时直接将C:\\Program Files\\Java\\jdk1.5.0\_11\\lib中的tools.lib拷贝到C:\\Program Files\\Java\\jre1.5.0\_11\\lib中即可。

如果还是不行，那请配置一下JDK的环境变量，并关闭IDE然后重新打开。

 

[](http://blog.csdn.net/lhjlhj123123/archive/2010/05/19/5607106.aspx)