Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Trouble building package #4

Open
michaelirey opened this issue Feb 29, 2012 · 10 comments
Open

Trouble building package #4

michaelirey opened this issue Feb 29, 2012 · 10 comments

Comments

@michaelirey
Copy link

Please forgive me, it has been so long since working with java. I am trying to get my this sample up on heroku.

But when I run: mvn package

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/home/vagrant/development/heroku/java/evanta-heroku-java/src/main/java/HelloWorld.java:[16,24] cannot find symbol
symbol  : constructor Server(java.lang.Integer)
location: class org.eclipse.jetty.server.Server

Not sure, but do I need to set a class path or something?

@jamesward
Copy link
Contributor

That is odd. It looks like it didn't use the Jetty dependency correctly or something. Have you made any changes to this project or are you using an exact copy?

@michaelirey
Copy link
Author

The only changes I have made was I commented out the annotation line, because it said annotations are not supported.

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/home/vagrant/development/heroku/java/evanta-heroku-java/src/main/java/HelloWorld.java:[9,5] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
    @Override

Other than that it is an exact copy.

Also I don't have a JAVA_HOME set.

Any thoughts?

@jamesward
Copy link
Contributor

What version of Java are you using?

@michaelirey
Copy link
Author

$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

@michaelirey
Copy link
Author

$ javac -version
javac 1.6.0_20

If this helps as well.

@jamesward
Copy link
Contributor

Hmm... I wonder why it's using 1.3 source compatibility. Maybe there is some Maven setting somewhere that is causing that. Perhaps try to remove your ~/.m2 directory or try to add the following to the pom.xml file:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>

@michaelirey
Copy link
Author

Perfect! Thanks for your help. Just deleting the ~/.m2 directory did not help.

Same annotation error. So I deleted the the ~/.m2 directory again, and added the snippet to the pom.xml file then everything worked!

Thanks for your help! I am up running my first java app on heroku!

@jamesward
Copy link
Contributor

Great! I'm not sure why that was happening but maybe we should add that to the pom.xml here. I'm going to reopen this so that some of the other Heroku guys can weigh-in.

@michaelirey
Copy link
Author

Perfect! Thanks again for your help.

@izza56
Copy link

izza56 commented Sep 9, 2012

Might be an idea to update the pom file in this "getting started with Heroku and Java" guide:
https://devcenter.heroku.com/articles/java

Thanks,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants