I made a new struts project in eclipse using the struts2-archtype-starter.
A few errors where in my project already before doing anything. Solved most of them but there is 1 the still give me some problems.
Missing artifact com.sun:tools:jar:1.5.0:system pom.xml
I tried to add the tools.jar to my repository manually but that didn't solve the issue.
My pom looks like this
<?xml version="1.0" encoding="UTF-8" ?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.divespot</groupId>
<artifactId>website</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>E-Divespot diving community</name>
<url>http://www.e-divespot.com</url>
<description>A website to support divers from all around the world.</description>
<dependencies>
<!-- Junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<!-- Struts 2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.0.11.2</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>2.0.11.2</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.0.11.2</version>
</dependency>
<!-- Servlet & Jsp -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<!-- Jakarta Commons -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.1.1</version>
</dependency>
<!-- Dwr -->
<dependency>
<groupId>uk.ltd.getahead</groupId>
<artifactId>dwr</artifactId>
<version>1.1-beta-3</version>
</dependency>
</dependencies>
<build>
<finalName>website</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.5</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>
</project>
sudo apt-get install openjdk-7-source
You can't use tools.jar from a repository.
Sadly, something in your dependency tree thinks that you can. So, you have to use an 'excludes' to get rid of the existing dependency, and then replace it with the following.
If you make the version in the below match that in the error message, you might not need the 'excludes'.
You need:
The Main Problem is that the mavan can not fine the tool.jar. so this problem occurs u just add tool.jar file in your project .The Tool.jar present in you java software C:\Program Files\Java\jdk1.6.0_14\lib
try this code i hope you run successfully http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 Strust2Testing Strust2Testing 0.0.1-SNAPSHOT war org.apache.struts
Having had the same problem recently none of the above solutions worked for me. I came across http://blog.samratdhillon.com/archives/598 and figured this to be the Eclipse bug mentioned there.
I had to delete all installed
jre
's from Eclipse's configuration(Window -> Preferences -> Java -> Installed JREs)
and only keep exactly one jdk. After that maven worked just fine without any modification toeclipse.ini
or anything else. This is with Ecplise Indigo Service Release 1.Confusingly the ${java.home} property actually will resolve its value from the JRE_HOME environment variable.
http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide (search for java.home)
If you don't want to change JAVA_HOME to the jre root then create the JRE_HOME variable instead.