This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven" Watch "Maven" New topic
Author

Maven

Sakiw Nila
Greenhorn

Joined: Dec 18, 2011
Posts: 1
Hi peeps,

Im trying to make a simple java EE6 application. But i get a error while compiling. Can anyone help me. The error looks like this.

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project primetest: Compilation failure: Compilation failure:
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\AutoCompleteBean.java:[6,30] package javax.enterprise.inject does not exist
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\AutoCompleteBean.java:[8,1] cannot find symbol
[ERROR] symbol: class Model
[ERROR] @Model
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\DateBean.java:[5,30] package javax.enterprise.inject does not exist
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\DateBean.java:[7,1] cannot find symbol
[ERROR] symbol: class Model
[ERROR] @Model
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\GreetingBean.java:[3,30] package javax.enterprise.inject does not exist
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\GreetingBean.java:[5,1] cannot find symbol
[ERROR] symbol: class Model
[ERROR] @Model


I allready used the two methods beneath in mine project POM ->

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<executable><!-- path-to-javac --></executable>
<compilerVersion>1.6</compilerVersion>
</configuration>

And this ->

<build>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
[...]
</build>
Ernesto Elias-Nieland
Ranch Hand

Joined: Sep 01, 2005
Posts: 53

Looks like you are missing the dependencies on these classes in your pom file. You have to add the required jar files for a project in the dependencies section of the pom.

This is similar to setting the classpath variable when you compile the code with a javac command. (Please check the maven docs for a better explanation of this. )


0x2B | ~0x2B
SCJD, SCJP 1.5, SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJA, IBM Test 150, 142, 700, 701, Oracle Test 1Z0-51
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I think you want one of these in your dependencies: http://repo1.maven.org/maven2/javax/enterprise/cdi-api/
If you can't figure out the exact dependency notation, let us know.

JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven