Eager to start developing own applications using IT Mill Toolkit? This section presents a QuickStart into running and debugging IT Mill Toolkit demos under Eclipse. The QuickStart includes a web server, so you do not need to have a full-weight web container such as Apache Tomcat installed.
If you have followed the instructions in Section 2.2, “Getting the Development Environment Up and Running” you can start Eclipse by
running C:\dev\eclipse\eclipse.exe (Windows)
or /opt/eclipse/eclipse (Linux or OS X).
When starting Eclipse for the first time, it asks where to save
the workspace. You can select any directory, but here we select
C:\dev\workspace (Windows) or
/home/<user>/workspace (Linux or OS
X). We suggest that you also set this as the default.
Close the Eclipse "Welcome" -screen when you are ready to continue.
If you have not yet downloaded the IT Mill Toolkit, instructions for downloading and unpacking are available at Section 2.1.1, “Installation”.
The installation directory of IT Mill Toolkit contains all necessary files to allow importing it as a ready-to-run Eclipse project:
Start Eclipse with any workspace you like. Switch to the Java Perspective through → → .
Select → to open the import dialog.
In the Import dialog, select → and click .
In the option, click the
button, and select the folder where
you unpacked IT Mill Toolkit, e.g.
c:/dev/itmill-toolkit-windows-5.x.x. Click
in the selection window. The Projects list
now shows a project named itmill-toolkit-examples.
Click in the Import
window to finish importing the project.
The newly imported project should look like Figure 2.4, “IT Mill Toolkit demo project imported into Eclipse”.
You can now browse the source code of the demo applications in Eclipse. The next section describes how you can run the demos.
Once the project is imported, as described above, you can run the Content Browser, including the demo applications, as follows:
Note that after the application has been launched once, it appears in the Favorites list. You can then click on the small dropdown arrow on the right side of the button on Eclipse toolbar and select .

Running the application in Web Mode will start an embedded web server and open a browser window with the Content Browser. The default system web browser is opened; make sure that the browser is compatible with IT Mill Toolkit. The Console view in the lower pane of Eclipse will display text printed to standard output by the application. Clicking on the red button will stop the server.
Note that executing the web application locally may cause a security warning from your firewall software because of the started web server. You need to allow connections to port 8888 for the Content Browser to work. Also, if the web service fails to start, make sure that no other service is using port 8888.
The Hosted Mode Browser of Google Web Toolkit is a special web browser that runs the client-side GWT Java code as Java runtime instead of JavaScript. This allows you to debug the client-side components in an IDE such as Eclipse.
To run the demo applications in the Hosted Mode Browser of Google Web Toolkit, follow the following steps:
Starting demo applications under the Hosted Mode Browser can take considerable time! This is especially true for the Reservation and Color Picker applications, which require compilation of custom widget sets. During this time, the Hosted Mode Browser is unresponsive and does not update its window. Compiling widget sets can take 5-30 seconds, depending on the hardware.
As with the Web Mode launcher, after you have run the Hosted Mode launcher once, you can click the dropdown marker on right of the button in the toolbar and select .
To use the Hosted Mode Browser in other projects, you need to create a launch configuration in Eclipse. See Section 9.7.6, “Hosted Mode Browser” for more detailed information about the Hosted Mode Browser and how to create the launch configuration.
To stop the launched Jetty web container that serves the Content Browser web application, select the Console tab and click on the button.
To clean up all terminated launches from the Console window, click on the button.
At some point when developing an application, you want to debug it. Running a web application in debug mode is easy in Eclipse. Next, we will show you how to debug the demo applications by inserting a breakpoint in the Calc example.
Select → from the main menu and the Debug configuration window will open.
Select → and click . The server will start and the web browser will open.
Open the source code for the Calc program. It is located in
WebContent/WEB-INF/src/com.itmill.toolkit.demo.Calc.
WebContent/WEB-INF/src is the project's source folder,
shown right below the JRE System Library. Double-click
the class to open the source code in the editor.
Insert a breakpoint in the init()
by right-clicking on the gray bar on the left of the editor window
to open the context menu, and select
.
Switch to the browser window and click the link (below More Examples) to open it.
Eclipse encouters the breakpoint and asks to switch to the Debug perspective. Click . The debug window will show the current line where the execution stopped as illustrated in Figure 2.8, “Execution Stopped at Breakpoint in Debug Perspective in Eclipse”:
You can now step forward or use any commands you would normally use when debugging an application in Eclipse. Note that you can only debug the application code in this way. If you are running the Hosted Mode browser you can also insert break-points in client side component code and debug it.
If you like, you can also use the imported IT Mill Toolkit demo project as a skeleton for your own project. Just remove any unnecessary files or files related to the demo applications from the project. The proper way of creating a new IT Mill Toolkit project will be described in the next section: Section 2.4, “Your First Project with IT Mill Toolkit”.