Google Web Toolkit with Netbeans?

I prefer to use Netbeans as my IDE rather than Eclipse. A few years ago, when I looked at the Google Web toolkit, GWT did not have a good Netbeans plugin, and everyone suggested using Eclipse. How is the situation now? Is there any better plugin on the market, or is Eclipse the best option?

+7
source share
4 answers

I prefer Netbeans over Eclipse. For development for GWT, I used the following configuration steps without installing the gwt4nb plugin. Since I use the IDE for code analysis and editing for reference only, I feel quite comfortable manipulating files and directories in the source tree directly. Although this may not be appropriate for your case, I think that for many developers, the steps should be good enough, because you can consider gwt development as a regular Java project.

  • Install JDK, NetBeans-SE. Extract the gwt package. I have a note for gwt-1.7.1 . If you are running on a 64-bit version of Windows, install the 64-bit netbeans and jdk, as well as the 32-bit JRE.

  • Copy the Hello sample from the gwt directory to the directory from the gwt directory directory. Create a project for existing Java source code and put the project in the same Hello directory. Then netbeans will create two files in the Hello directory: nbbuild.xml and manifest.mf and create its own nbproject directory in the Hello section. I just ignore these files.

  • In the Netbeans Projects window, right-click Libraries and select Add JAR to add jar files from the gwt directory.

  • In the netbeans Files window (and not the Projects window), you will see the source file "build.xml" that comes with the Hello sample. Edit this file so that "gwt.sdk" points to the directory location of the gwt package. On Windows 64bit, add the jvm property to the java task. It will look (only recently added only jvm = ...):

    <target name = "hosting" depends = "javac" description = "Run placement mode">
    <java failonerror = "true" fork = "true" classname = "com.google.gwt.dev.HostedMode"
    jvm = "C: \\ Users \\ youhere \\ Programs \\ jre6.32 \\ bin \\ java">
    <class path>

  • Use the Files window, click to expand the file "build.xml" node. Then right-click on the "hosted" ant target in the "build.xml" section and select "Run Target" in the context menu to create and run the host mode.

The ant goals from "build.xml" that you usually use:

  • "build": use this to create javascript.
  • hosted: use this to create java and start the hosted server and browser.

Once the running server is running, you can run the "build" target to create javascript and immediately get the result served by the running server without restarting the server. Use a normal browser to see the javascript version on "localhost: 8888". You can install another port by editing the "build.xml" file.

I usually copy the Hello sample to another directory and use it as a starting point for a new project. After that, manually edit the files to match the naming structure of the projects and directories.

I also copy the other samples from the gwt package to a new directory, and then create and run them to use as a reference to the code. If you also want to develop a servlet, take a look at the DynaTable sample servlet and create or copy the files to the same directory structure in your project.

Note on the gwt4nb plugin: I installed it, but realized that it was too heavy for me. With the above manual setting, I can do everything I need without any difficulties.

+8
source

I would say that Eclipse is the best free option. Intellij IDEA (paid version) also has good GWT support, but it's not as good as Eclipse .

I think the only official support for eclipse is see here: https://developers.google.com/web-toolkit/download

Based on my personal experience, if you want to have good integration between GWT and your IDE , go to Eclipse . If you intend to use Maven , I also suggest M2E http://m2eclipse.codehaus.org/

EDIT

I forgot to say the most important thing. Netbeans , by the way, seems to have good GWT support, but I never tested it: http://netbeans.org/kb/docs/web/quickstart-webapps-gwt.html

+6
source

I am sure that this is not the right and appropriate answer. But if you like bargaining, this is just an idea.

 sudo -i cd ~/gwt ./projectCreator -ant build -out projects/myapplication ./applicationCreator -out projects/myapplication myapplication.client.MyApp 

Then you can import the project ...

  • In Netbeans, create new projects and select 'Java Project With Existing Ant Script',
  • Set location to myapplication folder created earlier Install Build Script in the build.ant.xml file created by projectCreator Set the project name for something more suitable.
  • Open the project properties and in the "Java Sources" section, click "Add Folder". Select the projects/myapplication/src folder and click OK

I apologize if you did not like this approach.

+3
source

Sounds like Battle for Eclipse and Netbean , but you're talking about the concerns of the GWT . So, I think that you can choose, as you prefer, depends on your experience. You can create GWTs in various IDEs, because I assume that the GWT works on it, the SDK is not on the IDE. But there are some points of view. Example: easy to create, test, develop..etc on each IDE.

I also personally love NetBean because of the beautiful GUI :). But I work with the Eclipse IDE because our team has been developed and configured on it for a long time, so it’s difficult for us to change the IDE (sometimes it’s very difficult to change the version of Eclipse, because we can’t imagine that the new version will be more reliable for our projects). But I do not mean that Eclipse is the best option, since I described that you can configure your GWT projects on any other IDE as well as your experience through the GWT SDK .

"... and everyone suggested using Eclipse.", Yes, you will see that most sample projects have been calculated using the Eclipse IDE. The only aspect for GWT, I think you have a chance to choose NetBean IDE without any worries.

You can develop a GWT project in NetBean IDE as follows:

1.) First open download and install the gwt4nb plugin. (you may have exp to install the plugin on the NetBean IDE)

2.) download the GWT SDK and extract it to your specific location.

3.) create a new Java Web application. Name your application and click Next until you go to the Frames tab. If you have successfully installed the gwt4nb plugin, you will see a list of Google Web Toolkit. Select the Google Web Toolkit framework.

4.) Then go to the installation folder of the GWT SDK. Name your GWT module and click Finish .

5.) Clean and create your project. (Remember to wait until you finish assembling.)

6.) Run the project, your browser should start and the "Click me!" Button. and the text "Hello GWT !!!" must be visible.

Greetings! You can now create a sample GWT project in NetBean IDE.

You can also create a GWT

  • Test case
  • Constants
  • Module
  • RPC Service
  • Uibinder

Right-click your_project > Other ... > Google Web Toolkit .

There are helpful tips for you!

+2
source

All Articles