How to open GWT samples in eclipse Helios and GWT 2.1.1?

What is the direct way to import one of the GWT samples into eclipse Helios + GWT 2.1.1. It looks like the contents of the zip file does not contain project files for eclipse.

I tried the following:

  • create a GWT project 'bla'
  • Delete the src ad war folder and replace it with the src and war folder from the sample
  • update project in eclipse
  • click 'run'

[ERROR] Could not find 'bla / bla.gwt.xml' on your class path; maybe a typo or maybe you forgot to include the classpath for the source?

So, I go to the startup configuration and remove the path for sample projects from the argument list. I also changed the name of the hosted html page to the one in the sample. Click "run" and:

[ERROR] Invalid version number "2.0" passed to external .gwtOnLoad (), expected "2.1"; your posting mode may be outdated;

Now I need an outdated version of GWT to run these samples? What happens, I just want to see a sample to learn a new concept.

+7
source share
7 answers

Reading the readme.txt file in the GWT sample directory I came across a solution that works on Eclipse 3.7. Assuming ant is installed on your computer, follow these steps from the examples directory:

ant eclipse.generate

This will create the .classpath and .project files needed to import the sample into Eclipse and run it.

Here is the relevant excerpt from README.txt:

- Option A: import the project into Eclipse (recommended) -

If you use Eclipse, you can simply import the generated project into Eclipse. We tested Eclipse 3.4 and 3.5. Later versions are likely to work as well; earlier versions may not be.

If the directory containing this file does not have a .classpath or .project, generate them by running 'ant eclipse.generate'

In Eclipse, go to the File menu and select:

File → Import ... → Existing projects in the workspace

Go to the directory containing this file, select "Mail". Be sure to uncheck the "Copy projects to workspace" check box if it is checked. Click Finish. Now you can view the project in Eclipse.

To start the web application in the GWT development mode, go to the "Run" menu and select:

Run → Open debugging dialog ...

In a Java application, you should find the launch configuration
with the name "Mail". Select and click "Debug".

Now you can use the built-in debugger to debug your web application into development mode.

In eclipse 3.7, instead of Run -> Open Debug Dialog ..., its Run -> Debug Configurations. After these commands I received samples of a showcase and mail. Should work for all other samples.

+2
source

The examples that come with the GWT SDK were built differently. Some of them are Maven builders, others use Ant. Eclipse can handle these general assemblies directly, but you must choose the right one.

So, if you want to open the Expenses project in eclipse, you would look in the root directory of the projects (for example .. / gwt2.4 / samples / Expenses), where you will find a file called pom. XML This is the Maven build file. To import it into your workspace, select:

  • File-> Import ...
  • Open Maven-> Existing Maven Projects and click Next.
  • Browse your file system until you get to the "Expenses" folder. Click on it and select "OK."

At this point, he will show you the projects in this directory in the "Projects: window pane" area ... only one in this case: /pom.xml com.google.gwt.sample.expenses: ... etc ..

  • check the box for this project, then>
  • Finally, he will ask you to display plugins. You will need to select the necessary plug-ins (for example m2e) in the "Actions" drop-down menu.

In other project folders you can find the build.xml file. This is the Ant build file. Import that you are doing something similar, but different (of course!):

  • File-> New-> Project ...
  • Open the Java folder and select "Java Project from Existing Ant Buildfile", Next>
  • Click the "Browse" button, go to the directory in the project folder and select the build.xml file and open it.
  • The project name should be filled in automatically, just select the advertisement that will be used in the middle window and click "Finish".
+1
source

Since only the src and war directory is included in this tutorial, the idea remains:

  • create a new project following this tutorial
  • delete any created part of the class of sample files that are automatically added (see Issue 1547 )

Unfortunately, the Google plugin does not allow you to create a new web application project without creating template files. Template files are good for the first try, but annoying if you want to start from scratch with the new GWT application.

alt text

  • copy the src and war directory to a place in an empty project
0
source

Following your ticket 5847 (there is no simple and easy way to make examples of work in eclipse),

  • like xo4yhamope , you need the correct version of GWT.
  • and you examined Issue 5038 about the error:

    Cannot find "xxxx.gwt.xml" in your class path.
    maybe a typo, or maybe you forgot to include an entry in the pathpath class for the source?

This message usually means that you tried to update the browser before the Dev mode had the opportunity to complete the loading of the module.
Upper and lower case jams occur because the module has been renamed to "sharewatcher", but dev mode cannot match "sharewatcher" to "StockWatcher" until it finishes loading the entire module.

So, it's just a matter of waiting a few seconds longer after the "Design Mode" panel says that I should go to http://127.0.0.1:8888/StockWatcher.html?gwt.codesvr=127.0.0.1:9997 ?

It seems a little messed up. He has to wait until he is ready before telling me about it, because users (like me) are going there as soon as the user interface is ready.

Another confusing part is that the server starts serving the main page as soon as this message appears in the user interface. Since this was happening, I assumed the server was completely shut down, although (as it turns out) this is not the case.

In any case, waiting a few more seconds seems Unable to find 'stockwatcher.gwt.xml' on your classpath " Unable to find 'stockwatcher.gwt.xml' on your classpath " problem. Thanks!

0
source

I am beginning to suspect that this is a mistake in the samples. I am adding this answer so that it can be marked as an answer when I receive confirmation of this.

I tried some other samples and came across this page . Upstairs explains a little how to load and import a sample.

Before you start

StockWatcher Project

This tutorial is based on GWT concepts and the StockWatcher application created in Create a Sample GWT Application . If you have not finished building a sample GWT Application tutorial and are familiar with the basic concepts of GWT, you can import the StockWatcher project encoded up to this point.

  • Download the StockWatcher project .
  • Unzip the file.
  • Import project into Eclipse
    • From the File menu, select the Import... menu item.
    • Select the import source General> Existing Projects in the Workspace. Click the Next button.
    • In the root directory, locate and select StockWatcher (from the unzipped file). Click the Finish button.

If you are using ant, edit the gwt.sdk property in StockWatcher / build.xml to indicate where you unzipped the GWT.

Now this is what I call direct and easy.

At this point, I had already built StockWatcher in a previous tutorial, but I was intrigued by the fact that it was explained in the same way as I tried it for the first time. So I downloaded the project and had the correct structure for the eclipse project. I tried to import it 'et voila' I have a project in eclipse. I'm out of the box (with warnings). So the samples are expected.

This experience makes me think that the sample projects are distorted (like eclipse projects) and need updating. Let me hope that my issue repor will produce results.

0
source

- Option A: import the project into Eclipse (recommended) -

If you use Eclipse, you can simply import the generated project into Eclipse. We tested Eclipse 3.4 and 3.5. Later versions most likely also work, earlier versions cannot.

If the directory containing this file does not have a .classpath or .project file, generate them by running 'ant eclipse.generate'

In Eclipse, go to the File menu and select:

File → Import ... → Existing projects in the workspace

Go to the directory containing this file, select "Mail".

Be sure to uncheck the "Copy projects to workspace" check box if it is checked.

Click Finish.

Now you can view the project in Eclipse.

Copy the readme.txt file provided by the samples. I tried this method, this is normal.

0
source

To import a GWT showcase (2.5.1), I took the following steps:

  • Create a New Google Web Application Project

    New → Other → Google → Web Application Project

  • Indicate the project name "Showcase" and the package name com.google.gwt.sample.showcase

  • Click Finish

  • Go to the eclipse plugin folder and go to gwt

  • In this folder, go to gwt-2.3. \ Samples \ Showcase

  • Copy (Ctrl C) all contents. Content a. CSI b. test work with. war e. build.xml e. README.txt

  • In the eclipse, right-click the Showcase project and paste it. Overwrite all files

  • Files should run without any problems

  • Right-click on the storefront and launch as a "web application"

  • You must have your showcase working like a gem!

For me, it worked like a charm;)

Link: http://simplestepswebdev.wordpress.com/2011/05/16/import-gwt-samples-into-eclipse/

0
source

All Articles