2

I am trying to figure out how to use external jar in GWT project.
I referred http://www.vogella.com/articles/GWTModules/article.html and it worked perfectly.
But the example explained using another project being included in the GWT project's build path instead of including the jar of that project.

I know this should not make a difference but when I created the jar of the external project (including sources) and used it in the client GWT gave me following error:

The import com.person cannot be resolved

What would be the problem?

Saeed Zarinfam
  • 9,818
  • 7
  • 59
  • 72
sachinpkale
  • 989
  • 3
  • 14
  • 35

2 Answers2

3

For using external gwt library jar file in your gwt eclipse project you have to add that jar file in library tab from java build path:

enter image description here

Saeed Zarinfam
  • 9,818
  • 7
  • 59
  • 72
  • Yes. I did that and as I am using Eclipse, it is not giving me any compile error. But when I do "GWT Compile Project", it is giving me "cannot be resolved" error. – sachinpkale Dec 21 '12 at 10:58
  • 1
    If you have gwt compile problem, you have to inherit require gwt module in your main gwt module. – Saeed Zarinfam Dec 21 '12 at 11:51
1

If you want to use external jar and use that jar classes in your client side. you have to inherit module package entry in client gwt module.gwt.xml

Just example a. com.test.Module2.xml so you have do entry like

<inherits name='com.test.Module2'/>
bNd
  • 7,512
  • 7
  • 39
  • 72