generics are not supported in -source 1.3

Hello
I used smartgwt-starter (Maven) to try out some of the examples. The original HelloWorld (with IButton) example did build and compile fine.
I proceeded to add some of the SmartGWT showcase widgets to the starter application(ButtonAppearanceSample) and added all the dependencies.
Doing so causes compilation error running gwt:gwt Here’s portion of the console output.

C:\Dev\smartgwt-starter\src\main\java\com\hiva\sample\common\ShowcasePanel.java:[151,32] for-each loops are not supported in -source 1.3
(use -source 5 or higher to enable for-each loops)
for (String dataURL : dataURLs) {

I am using
java 1.6
mvn 2.0.6
IntelliJ 7.0

Any help would be greatly appreciated
Thanks

Why are you using the -source 1.3? The source level must be JDK 5 which GWT 1.5.3 fully supports.

Sanjiv

That was my question. Like I mentioned I am using JDK 1.6 so I’m wondering where -source 1.3 is coming from. I have not made any major changes to smartgwt-starter only packaging and adding couple Buttons from the sample to try out. pom.xml and the rest are intact.

Arash

This is an issue with your build environment. I’m now sure what maven smartgwt-starter you’re referring to but please try to troubleshoot the issue yourself by running your maven build with the -X argument which will turn on verbose logging. Then look for the line where the java compiler is being invoked. Without any details its going to be hard to help.

Sanjiv

Sjivan

Thanks for immediate response. The smartgwt-starter I was talking about is uploaded in sourceforgeand posted here:
http://forums.smartclient.com/showthread.php?t=3027

Let’s start fresh because I am running to different problems using this starter. I am interested in maven build for smartgwt and this was the only option I could find. The simple Hellow World IButton in this app works just fine after maven finds all dependencies. The smartgwt dependecy portion of pom.xml reads:

    <dependency>
		<groupId>com.smartgwt</groupId>
		<artifactId>smartgwt</artifactId>
		<version>1.0b1</version>
		<type>jar</type>
</dependency>

Now let’s try to add a simple smartgwt widgets like ImgButton and follow exact same pattern that you see in Application entry point.

Once you run mvn gwt:gwt it shows compile issues complaining at:

c:\progra~1\jetbra~1\intell~1.1\jre\jre\bin\java -Dclassworlds.conf=C:\Tools\maven-2.0.6\bin\m2.conf -Dmaven.home=C:\Tools\maven-2.0.6 -Didea.launcher.port=7532 “-Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 8.0.1\bin” -Dfile.encoding=windows-1252 -classpath “C:\Tools\maven-2.0.6\boot\classworlds-1.1.jar;C:\Program Files\JetBrains\IntelliJ IDEA 8.0.1\lib\idea_rt.jar” com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher --no-plugin-registry --fail-fast --no-plugin-updates --strict-checksums -f C:\Dev\smartgwt-starter\pom.xml com.totsp.gwt:maven-googlewebtoolkit2-plugin:2.0-beta26:gwt

C:\Dev\smartgwt-starter\src\main\java
et\sf\gwtstarter\sample\ui\gwt\client\Application.java:[35,17] cannot find symbol
symbol : method setShowRollOver(boolean)
location: class com.smartgwt.client.widgets.ImgButton

C:\Dev\smartgwt-starter\src\main\java
et\sf\gwtstarter\sample\ui\gwt\client\Application.java:[36,17] cannot find symbol
symbol : method setShowDown(boolean)
location: class com.smartgwt.client.widgets.ImgButton

The app is pretty small, I’d be more than happy to send it to you but I’m sure you can try out the maven starter and see it for yourself

Thanks in advance

I’m running this in a maven build no problem. Post your whole pom and I can probably help. One guess is your repositories. I use the SC repo and the GWT-MAVEN repo:

        <repository>
		<id>smartclient</id>
		<url>http://www.smartclient.com/smartgwt/maven2</url>
	</repository>
	<repository>
		<id>gwt-maven</id>
		<url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
	</repository>

Now that you’re using the right repos, move to the SNAPSHOT build:

		<dependency>
			<groupId>com.smartgwt</groupId>
			<artifactId>smartgwt</artifactId>
			<version>1.0b2-SNAPSHOT</version>
		</dependency>

I just threw some test code into my app that uses the two ImgButton methods from your error. It builds fine. Hope this helps.

Resolved

Scoobydoo :wink:

The correct repository & version [1.0b2-SNAPSHOT] resolved the issue.

Thanks a million for taking time
Arash