1

I create sample application of gwtupload. https://code.google.com/p/gwtupload/ Its working fine with the .jar I downloaded from project home.

But for my custom requirement I downloaded project from git https://github.com/manolo/gwtupload and made changes as per my requirement and created .jar file. Then I imported it to my project and included in classpath. Even eclipse is not giving any error in editor mode. But when I debug and open URL its giving me following error.

[ERROR] [uploadtest] - Line 3: The import gwtupload cannot be resolved
[ERROR] [uploadtest] - Line 53: SingleUploader cannot be resolved to a type
[ERROR] [uploadtest] - Line 54: IUploader cannot be resolved to a type

Tried stackoverflow thread Eclipse error: "The import XXX cannot be resolved" but didn't help me out.

Do I need to create .jar file with other parameters than creating .jar using Export in eclipse?

Community
  • 1
  • 1
Vicky Thakor
  • 3,847
  • 7
  • 42
  • 67
  • Have you addes source files (*.java) to your jar? – fascynacja Sep 28 '13 at 09:48
  • no...let me try that. Nice catch man. – Vicky Thakor Sep 28 '13 at 09:58
  • Why do you want to change the standard way of generating libraries? Usually any open-source project uses an opensource tool (maven, ant, gradle) to produce the distribution files, and the maintainer takes care that running a single command everything works. Depending on an IDE to produce the product is a bad idea. – Manolo Carrasco Moñino Oct 08 '13 at 05:40

2 Answers2

2

You should export the .jar with "Java source files and resources". enter image description here

fascynacja
  • 1,625
  • 4
  • 17
  • 35
  • 2
    I am happy that worked for you:) Explanation in simple words: GWT allows you to write Java code, which is compiled into JavaScript. The tool which is doing the magic is GWT Compiler. The Input to the GWT compiler are "Java files", and the Output is highly optimized "JS + HTML" code. Therefore if you want to use external JAR's, the GWT Compiler needs to know how the Java code (from this jar) looks like. You can read more here: http://www.gwtproject.org/learnmore-sdk.html – fascynacja Sep 28 '13 at 14:16
0

Gwtupload is a maven project, so the easiest way to produce the .jar is just open a command-line session, change to the gwt-upload/core folder and run:

 mvn clean package
Manolo Carrasco Moñino
  • 9,723
  • 1
  • 22
  • 27