Java Can';不再在eclipse上运行maven安装(找不到tools.jar)
我正在ubuntu 16.04上工作,我有一个eclipse项目,我不能再编译了。每次我尝试时都会出现以下错误:Java Can';不再在eclipse上运行maven安装(找不到tools.jar),java,eclipse,maven,Java,Eclipse,Maven,我正在ubuntu 16.04上工作,我有一个eclipse项目,我不能再编译了。每次我尝试时都会出现以下错误: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project TwavoxManager: Fatal error compiling: tools.jar not found: /usr/lib/jvm/j
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project TwavoxManager: Fatal error compiling: tools.jar not found: /usr/lib/jvm/java-8-openjdk-amd64/jre/../lib/tools.jar -> [Help 1]
我首先可以毫无问题地编译它,但我必须在我的系统(openJDK8)上重新安装java
我尝试了这个链接的解决方案
但问题是openJDK8有JDK+JRE,对吗?
我在这里完全迷路了
编辑:添加了pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cineapps</groupId>
<artifactId>TwavoxManager</artifactId>
<packaging>jar</packaging>
<name>TwavoxManager</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<!-- COMPILER -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- RESOURCES -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<!-- SHADE -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>TwavoxManager-${project.version}-min</finalName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>cineapps.TwavoxManager.app.App</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/res</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.miglayout/miglayout-swing -->
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>4.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.3</version>
</dependency>
</dependencies>
<version>1.0</version>
</project>
4.0.0
电影应用
更新pom.xml中的插件条目
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
org.apache.maven.plugins
maven编译器插件
3.1
1.8
1.8
并配置JDK项目
右键单击项目,生成路径->配置生成路径。在右侧选项中选择“JRE系统库”,然后选择编辑并配置您的JDK请共享您的pom.xml,并将特定于项目的JRE设置为project@Zia添加了pom.xml请修改pom中的插件条目,org.apache.maven.plugins maven编译器插件3.1 1.8 1.8我现在有一个错误:[错误]无法在TwavoxManager项目上执行目标org.apache.maven.plugins:maven编译器插件:3.1:编译(默认编译):编译失败[错误]此环境中未提供编译器。也许您运行的是JRE而不是JDK?右键单击您的项目,Build Path->Configure Build Path。在正确的选项中选择“JRE系统库”选择编辑,然后配置您的JDKIt不起作用,我仍然有相同的错误,我在我的原始Postlight中提供了我的JRE系统库的屏幕。我在终端中运行echo:$JAVA_HOME,得到了这个:/usr/lib/jvm/JAVA-8-openjdk-amd64/edit该JRE并查看了安装的JRE,指向您提到的JDK“/usr/lib/jvm/java-8-openjdk-amd64/”jre中没有JDK文件夹,但我有java/bin和java/jre/bin