« | Main

Configuring ZKStudio in Eclipse with Tomcat6 on Ubuntu

By admin | March 30, 2009

This explains how to get the hello world demo zul file working in ZK Studio in Eclipse with Tomcat6 on a localhost system on Ubuntu Intrepid.

I have just had a nightmare couple of days getting this working so I thought I would document how I solved it in the end incase it helps anybody else. I am sure there is a better way to solve this but at least this works.

First install tomcat6
sudo apt-get install tomcat6

This will install tomcat to /usr/share/tomcat6 (known as CATALINA_HOME)
and also to /var/lib/tomcat6 (known as CATALINA_BASE)

Eclipse doesn’t like this split location installation. The way to make it happy is to copy the link to “conf” from /var/lib/tomcat6 to /usr/share/tomcat6 (e.g. in Nautilus navigate to /var/lib/tomcat6 right click on the conf folder and select “copy”. Then go to /usr/share/tomcat6 , right click and select “paste”)

It will also later be looking for a file catalina.policy in the conf folder but on my system the file is called 03catalina.policy and is in conf/policy.d So I copied this file to where it is expected and renamed it.

Eclipse workspace can easily get corrupted. If anything stops working, assume it is corrupt. DONT try and fix anything with this suspect workspace. Just quit Eclipse and restart it specifying a new workspace location.

Once you have a clean workspace do the following:

1: Set up tomcat

In the window at the bottom with the tabs (Problems, Tasks, Properties, Servers etc)
Select Servers
Right click on the background and choose New->Server
Choose tomcat 6 server and click next (if it wont let you do this you have a corrupt workspace. See above for solution)
browse to /usr/share/tomcat6 for tomcat location (if it complains make sure you have copied conf and catalina.policy as explained above)

2: Set up ZK packages
(I’m assuming you have done the bit that adds ZK)
Go to Window, Preferences, ZK, ZK Packages
Add directory /home/mike/zkbinwhatever
put a check in the box and click a few oks

3:Create a project
File, New dynamic web project
choose any name
under configuration click modify
add check to “ZK Support”
click a few oks and finish

4: create a zul
right click the project name and select “new zul”
change the container to /whatevername/WebContent
click finish

5: Run it
Choose Run, run
select an existing server (the tomcat 6 one)
your project should be in the right hand column as an existing project
The server should start and status = synchronised
Up should pop the Hello World demo!!!

Topics: all, tomcat | No Comments »

Comments