Hi Joel,

Google tells me that you might be compiling your project with a JDK
that is a newer version than the JVM you are subsequently using to run
the application. Is that possible in your case ?

Michael

On 5 August 2011 12:38, joel rodriguez <[email protected]> wrote:
> Hi Michael,
>
> Here's the 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>org.geotools</groupId>
>   <artifactId>tutorial</artifactId>
>   <version>8-SNAPSHOT</version>
>   <packaging>jar</packaging>
>
>   <name>tutorial</name>
>   <url>http://maven.apache.org</url>
>
>
>  <properties>
>         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>       <geotools.version>8-SNAPSHOT</geotools.version>
> </properties>
>
>
>
>   <dependencies>
>         <dependency>
>             <groupId>junit</groupId>
>             <artifactId>junit</artifactId>
>             <version>3.8.1</version>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.geotools</groupId>
>             <artifactId>gt-shapefile</artifactId>
>             <version>${geotools.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.geotools</groupId>
>             <artifactId>gt-swing</artifactId>
>             <version>${geotools.version}</version>
>         </dependency>
>     </dependencies>
>     <repositories>
>         <repository>
>             <id>maven2-repository.dev.java.net</id>
>             <name>Java.net repository</name>
>             <url>http://download.java.net/maven/2</url>
>         </repository>
>         <repository>
>             <id>osgeo</id>
>             <name>Open Source Geospatial Foundation Repository</name>
>             <url>http://download.osgeo.org/webdav/geotools/</url>
>         </repository>
>         <repository>
>             <snapshots>
>                 <enabled>true</enabled>
>             </snapshots>
>             <id>opengeo</id>
>             <name>OpenGeo Maven Repository</name>
>             <url>http://repo.opengeo.org</url>
>         </repository>
>     </repositories>
>
> </project>
>
>
> and full trace error:
>
> Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad
> version number in .class file
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>     at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
>
> Thanks,
>
> Joel
>
> On Thu, Aug 4, 2011 at 10:19 PM, Michael Bedward <[email protected]>
> wrote:
>>
>> Hi Joel,
>>
>> Please post your complete pom.xml file and the full error trace if you
>> can.
>>
>> cheers
>> Michael
>>
>> On 5 August 2011 11:50, joel rodriguez <[email protected]> wrote:
>> > Hi Michael,
>> >
>> > I followed the tutorial to the end, I had many errors but all except one
>> > were solved when I added the </project> at the end of the pom.xml file
>> > (I
>> > was deleting that tag when I copy/paste the dependencies into the
>> > pom.xml).
>> >
>> > I had another error on:
>> >
>> >  // Now display the map
>> >         JMapFrame.showMap(map);
>> >
>> > but I saw your post about using snapshot 8 to fix this issue:
>> >
>> >
>> > http://osgeo-org.1803224.n2.nabble.com/Problem-method-JMapFrame-showMap-td6578002.html
>> >
>> > That made the error go away but when I go to run the project I get this
>> > error in the console:
>> >
>> > Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad
>> > version number in .class file
>> >
>> > I deleted all my files and started over using 8 SNAPSHOT for version
>> > field
>> > when I created my class to see if this would fix it, but even after
>> > doing
>> > that it stills gives me the same error when running the project. I was
>> > hoping you could guide me in the right track.
>> >
>> > Thanks,
>> >
>> > Joel
>> >
>> > Here's an extract from my pom.xml if it helps diagnose:
>> >
>> >  <groupId>org.geotools</groupId>
>> >   <artifactId>tutorial</artifactId>
>> >   <version>8-SNAPSHOT</version>
>> >   <packaging>jar</packaging>
>> >
>> >   <name>tutorial</name>
>> >   <url>http://maven.apache.org</url>
>> >
>> >
>> >  <properties>
>> >
>> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>> >       <geotools.version>8-SNAPSHOT</geotools.version>
>> > </properties>
>> >
>> > On Wed, Aug 3, 2011 at 11:44 PM, Michael Bedward
>> > <[email protected]>
>> > wrote:
>> >>
>> >> Good to hear you're in business now Joel.
>> >>
>> >> Things always work better on a mac.
>> >>
>> >> Michael
>> >>
>> >> On 4 August 2011 12:55, joel rodriguez <[email protected]> wrote:
>> >> > Hi Michael & Jody,
>> >> >
>> >> > Thank you for all the advise and input. I had read those links in
>> >> > google
>> >> > and
>> >> > in the other options section in the quickstart example but no matter
>> >> > what I
>> >> > did I could not get the errors to disappear.
>> >> >
>> >> > I turned to my Mac and downloaded the helios version of Eclipse this
>> >> > time
>> >> > and installing M2eclipse from the IDE and it install on the first try
>> >> > without problems. I will continue to follow the tutorial, it looks
>> >> > like
>> >> > it
>> >> > will go smooth now.
>> >> >
>> >> > Not sure if the errors came from using the Endigo version of Eclipse
>> >> > on
>> >> > my
>> >> > windows machine. Thank you for all your assistance.
>> >> >
>> >> > Best Regards,
>> >> >
>> >> > Joel
>> >> >
>> >> > On Tue, Aug 2, 2011 at 4:04 AM, Jody Garnett <[email protected]>
>> >> > wrote:
>> >> >>
>> >> >> Hi Micheal and Joel:
>> >> >> I have not tried the quick start since maven started being included
>> >> >> in
>> >> >> the
>> >> >> normal eclipse download (so some of the "extra" steps can probably
>> >> >> be
>> >> >> removed now).  Please let me know how you go ...
>> >> >> I also note that the "snapshot" repository provided by OpenGeo
>> >> >> generally
>> >> >> performs very well; and the advice in the quick start about
>> >> >> switching
>> >> >> to
>> >> >> that if you have troubles is well founded.
>> >> >> --
>> >> >> Jody Garnett
>> >> >>
>> >> >> On Tuesday, 2 August 2011 at 12:18 PM, Michael Bedward wrote:
>> >> >>
>> >> >> Hi Joel,
>> >> >>
>> >> >> Please cc your replies to the list as well so that other people can
>> >> >> chip
>> >> >> in.
>> >> >>
>> >> >> It sounds like you have Maven 2 properly installed.
>> >> >>
>> >> >> Regarding your IDE, I don't use Eclipse myself (NetBeans is so much
>> >> >> easier :) but most of the other GeoTools developers use it so
>> >> >> perhaps
>> >> >> one of them can offer advice. Meanwhile, just double check that you
>> >> >> have followed all the steps in the Eclipse Quickstart:
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html
>> >> >>
>> >> >> Also, a quick Google search comes up with many possible leads
>> >> >> including these two:
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://stackoverflow.com/questions/4297533/error-while-installing-maven-integration-for-eclipse
>> >> >>
>> >> >> http://judygichoya.posterous.com/maven-installation-into-eclipse-1
>> >> >>
>> >> >> Regarding building from the command line, it's not unknown for Maven
>> >> >> to freeze or issue download errors when internet traffic is high.
>> >> >> Usually the problems resolve when you try again a few minutes later.
>> >> >> However, if you are working through a proxy server or firewall you
>> >> >> will need to check that it's not a permission problem. Sometimes
>> >> >> there
>> >> >> are problems using Maven mirror repositories as well but I'm
>> >> >> guessing
>> >> >> that you are working with the default pom settings (which use the
>> >> >> Maven Central repo).
>> >> >>
>> >> >> Let us know how you go.
>> >> >>
>> >> >> Michael
>> >> >>
>> >> >>
>> >> >> On 2 August 2011 10:30, joel rodriguez <[email protected]>
>> >> >> wrote:
>> >> >>
>> >> >> Hi Michael,
>> >> >>
>> >> >> Thank you so much for you response. I uninstalled Maven 3 by
>> >> >> deleting
>> >> >> the
>> >> >> directory and the m2/repository folders. Then I installed Maven
>> >> >> 2.2.1
>> >> >> and
>> >> >> adjusted the environment variable for 2.2.1, then I ran the mvn
>> >> >> --version
>> >> >> (outside of the maven directory) and it gave me the version info
>> >> >> correctly.
>> >> >>
>> >> >> I would rather execute the quickstart tutorial from within the IDE
>> >> >> but
>> >> >> I
>> >> >> cannot get either to that or from the command prompt to work, even
>> >> >> after
>> >> >> 2.2.1. I did go to the preferences and added the installation to
>> >> >> call
>> >> >> the
>> >> >> 2.2.1 maven version instead of the default 3. but when I try to
>> >> >> follow
>> >> >> the
>> >> >> tutorial I get errors when instaling maven intergration:
>> >> >>
>> >> >> "Some sites could not be found.  See the error log for more detail.
>> >> >> No repository found at
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://repository.sonatype.org/content/sites/forge-sites/m2e/0.10.0/N/201002041057/.
>> >> >> Unable to read repository at
>> >> >>
>> >> >> http://download.eclipse.org/releases/indigo/201106220900/content.jar.
>> >> >> Read timed out
>> >> >> Cannot complete the install because one or more required items could
>> >> >> not
>> >> >> be
>> >> >> found.
>> >> >>   Software being installed: Maven Integration for Eclipse (Required)
>> >> >> 0.12.1.20110112-1712
>> >> >>   (org.maven.ide.eclipse.feature.feature.group
>> >> >> 0.12.1.20110112-1712)"
>> >> >>
>> >> >> then I tried from the cmd and it freezes at the last line when
>> >> >> downloading
>> >> >> dependencies:
>> >> >>
>> >> >>    ----from cmd--
>> >> >>   Microsoft Windows [Version 6.1.7600]
>> >> >> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>> >> >> C:\Users\JoelRodriguez>mvn --version
>> >> >> Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
>> >> >> Java version: 1.7.0
>> >> >> Java home: C:\Program Files\Java\jdk1.7.0\jre
>> >> >> Default locale: en_US, platform encoding: Cp1252
>> >> >> OS name: "windows 7" version: "6.1" arch: "x86" Family: "windows"
>> >> >> C:\Users\JoelRodriguez>cd\
>> >> >> C:\>cd java
>> >> >> C:\java>mvn archetype:generate
>> >> >> [INFO] Scanning for projects...
>> >> >> [INFO] Searching repository for plugin with prefix: 'archetype'.
>> >> >> [INFO] org.apache.maven.plugins: checking for updates from central
>> >> >> [INFO] org.codehaus.mojo: checking for updates from central
>> >> >> [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin:
>> >> >> checking
>> >> >> for up
>> >> >> dates from central
>> >> >> Downloading:
>> >> >> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
>> >> >> ype-plugin/2.0/maven-archetype-plugin-2.0.pom
>> >> >> Downloading:
>> >> >> http://repo1.maven.org/maven2/org/apache/maven/archetype/maven-arch
>> >> >> etype/2.0/maven-archetype-2.0.pom
>> >> >> Downloading:
>> >> >> http://repo1.maven.org/maven2/org/apache/maven/maven-parent/16/mave
>> >> >> n-parent-16.pom
>> >> >> Downloading:
>> >> >> http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom
>> >> >> Downloading
>> >> >> :
>> >> >> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
>> >> >> ype-plugin/2.0/maven-archetype-plugin-2.0.jar
>> >> >> 43396/?
>> >> >>
>> >> >> Is there a step I am missing? Thank you again for your input,
>> >> >>
>> >> >> Joel
>> >> >> On Sun, Jul 31, 2011 at 10:11 PM, Michael Bedward
>> >> >> <[email protected]> wrote:
>> >> >>
>> >> >> Hello,
>> >> >>
>> >> >> Yes, this looks like a problem at your end rather than with
>> >> >> GeoTools.
>> >> >>
>> >> >> Firstly, which version of Maven did you install ?  At the moment
>> >> >> GeoTools requires Maven 2 rather than Maven 3 (e.g. i am using
>> >> >> version
>> >> >> 2.2.1). To verify that it is installed correctly, from a command /
>> >> >> terminal window go to some directory other than the one where Maven
>> >> >> is
>> >> >> installed and type "mvn --version". The Maven installation docs are
>> >> >> here:
>> >> >>
>> >> >> http://maven.apache.org/download.html
>> >> >>
>> >> >> You don't mention whether you are trying to build the Quickstart
>> >> >> example from the command line or from within an IDE. If the latter,
>> >> >> you need to check that Maven is accessible from within the IDE and
>> >> >> that the same version is being used (NetBeans comes with its own
>> >> >> installation of Maven 3 bundled but you can tell it to use a local
>> >> >> installation via the Preferences dialog).
>> >> >>
>> >> >> Michael
>> >> >>
>> >> >> On 1 August 2011 11:29,  <[email protected]> wrote:
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> I am a beginner in the Maven quickstart project, I was wondering if
>> >> >> you
>> >> >> would help me get the quickstart example to work. I have been trying
>> >> >> to
>> >> >> figure it out for a week with no avail.
>> >> >>
>> >> >> I get the missing artifact errors in my porm.xml here:
>> >> >>
>> >> >>  <dependency>
>> >> >>            <groupId>org.geotools</groupId>
>> >> >>            <artifactId>gt-render</artifactId>
>> >> >>            <version>${geotools.version}</version>
>> >> >>        </dependency>
>> >> >>        <dependency>
>> >> >>            <groupId>org.geotools</groupId>
>> >> >>            <artifactId>gt-swing</artifactId>
>> >> >>            <version>${geotools.version}</version>
>> >> >>        </dependency>
>> >> >>
>> >> >>        <dependency>
>> >> >>            <groupId>org.geotools</groupId>
>> >> >>            <artifactId>gt-shapefile</artifactId>
>> >> >>            <version>${geotools.version}</version>
>> >> >>
>> >> >> all the imports have the x (error) next to them. I think it may be
>> >> >> because I could never get Maven installed from the help, install
>> >> >> software
>> >> >> menu. I had to download it and install it manually.
>> >> >>
>> >> >> Any help you may provide is greatly appreciated.
>> >> >>
>> >> >> Thanks
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> ------------------------------------------------------------------------------
>> >> >> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>> >> >> The must-attend event for mobile developers. Connect with experts.
>> >> >> Get tools for creating Super Apps. See the latest technologies.
>> >> >> Sessions, hands-on labs, demos & much more. Register early & save!
>> >> >> http://p.sf.net/sfu/rim-blackberry-1
>> >> >> _______________________________________________
>> >> >> Geotools-gt2-users mailing list
>> >> >> [email protected]
>> >> >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>> >> >>
>> >> >
>> >> >
>> >
>> >
>
>

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to