简体   繁体   English

错误:找不到或加载主类工具

[英]Error: Could not find or load main class Tool

My configuration is below: 我的配置如下:

  • Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T14:57:37+03:00) Apache Maven 3.3.3(7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T14:57:37 + 03:00)
  • Maven home: /usr/local/Cellar/maven/3.3.3/libexec Maven主页: /usr/local/Cellar/maven/3.3.3/libexec
  • Java version: 1.8.0_66, vendor: Oracle Corporation Java版本:1.8.0_66,供应商:Oracle Corporation
  • Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre Java主目录: /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre
  • Default locale: en_US, platform encoding: UTF-8 默认语言环境:en_US,平台编码:UTF-8
  • OS name: "mac os x", version: "10.11.1", arch: "x86_64", family: "mac" 操作系统名称:“ mac os x”,版本:“ 10.11.1”,拱门:“ x86_64”,家族:“ mac”

I use Spring Tool Suite 3.7.1.RELEASE (Build Id: 201510041213). 我使用Spring Tool Suite 3.7.1.RELEASE(Build ID:201510041213)。

I did all settings about Java, Maven and STS but when I try to run any Maven command, STS is throwing this exception, although it runs on terminal correctly. 我已经完成了有关Java,Maven和STS的所有设置,但是当我尝试运行任何Maven命令时,STS都会抛出此异常,尽管它可以在终端上正确运行。

I had a project that I had been developing on STS version 3.6.4.RELEASE, but when I downloaded STS 3.7.1.RELEASE on a different PC, imported the project and tried to build/clean/... with maven, it would show this error ( Error: Could not find or load main class Tool ) as well. 我有一个我正在STS 3.6.4.RELEASE版本上开发的项目,但是当我在另一台PC上下载STS 3.7.1.RELEASE时,导入了该项目并尝试使用maven进行构建/清理/...。也会显示此错误( Error: Could not find or load main class Tool )。

What I did was copy the version 3.6.4.RELEASE from one computer to the other computer, and then I could build the project. 我所做的是将3.6.4.RELEASE版本从一台计算机复制到另一台计算机,然后可以构建该项目。 I then proceeded to update STS through eclipse rather than downloading from the site, and now I'm running 3.7.1.RELEASE on the second computer and the project continues to be able to launch now :) 然后我继续通过eclipse而不是从站点下载来更新STS,现在我在第二台计算机上运行3.7.1.RELEASE,并且该项目现在仍然可以启动:)

AFAIK these were my steps then: AFAIK这些是我当时的步骤:

  1. Get older version of STS (3.6.4.RELEASE in my case, that i had been using on a different pc, copied it and deleted ini file because it caused an error at startup) 获取旧版本的STS(在我的情况下为3.6.4.RELEASE,因为我在另一台PC上使用过,所以将其复制并删除了ini文件,因为它在启动时引起了错误)
  2. Import project 导入项目
  3. Update STS through eclipse 通过Eclipse更新STS
  4. Maven now builds the project without errors Maven现在可以正确地构建项目

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM