Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #30475
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2014-12-03 07:39 -0800 |
| References | <608c8d53-aa5b-493f-87eb-4c1b02d0e24b@googlegroups.com> |
| Message-ID | <1fdcafc0-e373-40ae-8b3f-6aa39ee4750c@googlegroups.com> (permalink) |
| Subject | Re: Javac works, but mvn compile fails |
| From | Kenneth Miller <kennethadammiller@gmail.com> |
On Wednesday, December 3, 2014 9:37:16 AM UTC-5, Kenneth Miller wrote:
> "mvn compile" produces tons of errors, here's the first:
>
> [ERROR] $HOME/workspace/JavaExamplePBServiceCall/src/main/java/example/ServicecallPiqi.java:[13,23] error: ';' expected
>
> but compilation with
>
> javac -cp $HOME/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar ServicecallPiqi.java
>
> succeeds just fine
>
> <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>example</groupId>
> <artifactId>JavaExamplePBServiceCall</artifactId>
> <packaging>jar</packaging>
> <version>1.0-SNAPSHOT</version>
> <name>PBServiceCallExample</name>
> <url>http://maven.apache.org</url>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>3.8.1</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>com.google.protobuf</groupId>
> <artifactId>protobuf-java</artifactId>
> <version>2.5.0</version>
> </dependency>
> </dependencies>
> </project>
I figured it out!
I just needed to add this:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
mvn was using a different compiler version... Why the hell would it do that? (rhetorical)
Anyway, my issue is resolved :)
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Javac works, but mvn compile fails Kenneth Miller <kennethadammiller@gmail.com> - 2014-12-03 06:37 -0800 Re: Javac works, but mvn compile fails Kenneth Miller <kennethadammiller@gmail.com> - 2014-12-03 07:39 -0800
csiph-web