Thursday, November 6, 2014

WALA Tips: Problems/errors when you are trying to run WALA examples

Today I tried to run examples of WALA, and I found and tackled some problems that you might find also. I made this post to help me remember how I solve those problem. :).

For a complete configuration manual you can refer to this WALA wiki. Here are the problem list:

1. The import org.eclipse.pde.internal.core.PDEStateHelper cannot be resolved

I use the latest Eclipse version (Luna) when this post written. This problem happens when I tried to build the project. There is that you can find in package, needs to import the org.eclipse.pde.internal.core.PDEStateHelper.

So to resolve this problem I downloaded the org.eclipse.pde.core_3.3.jar that contain  the org.eclipse.pde.internal.core.PDEStateHelper class. And add that file to my java build path libraries.  You can do that by right click you project, and then from the context menu you choose: 
"Build Path -> Configure Build Path...". It will open the project Java Build Path configuration dialog. After that you can open "Libraries" tab and then click "Add External JARs", it will open file browser and select you org.eclipse.pde.core_3.3.jar. Close your Java Build Path configuration dialog by clicking on "OK" button. Then try to build your project once again. Viola! I hope your error will vanish just like what I did. 

2. Problem when trying to run example 1 (the SWTTypeHierarchy) 

When you are trying to run example 1, SWTTypeHierarchy that you can find in, probably you could get this error:

"{resource_loc:/} "



This problem happen because the SWTTypeHierarchy expecting the JLex.jar to be found at directory. So what you need to do is put your JLex.jar file in the root of project root directory. After doing this step you will able to run the example 1 correctly. If successful, you should see a new window pop up with a tree view of the class hierarchy of JLex.

3. Problem when trying to run example 2 (the PDFTypeHierarchy)

When you are trying to run example 2, probably you're going to have several problems. First problem is the configuration file. This configuration file contain path configuration of your java runtime directory "java_runtime_dir" and "output" directory. If you haven't yet created the file you'll get this message:

" Unable to set up wala properties "

To solve that you need to create the file in project dat directory. You can copy or rename the (that exist in the dat directory) into After that try to run the example once more and you'll get another error (sorry guys).

" property_file_unreadable"

To solve that you need to configure another file, the This file contain executable path configuration of your pdf viewer and graphviz (you can install in Linux by using apt-get install graphviz). You need to create in project and put them in the dat directory. You can copy or rename the (that exisst in the dat directory) into And then try to run once more your project. If there is another error please stay put with me. :). 

If you get these exceptions:

1. Exception in thread "main"

Probably you didn't set the java runtime directory correctly in your file. You must direct your path to the java jre library path. In case of my environment it should be like this: 


2. spawning process [null, -Tpdf, -o,, -v,]Exception in thread "main" 

Probably you haven't set your an output directory in your file. Make sure to create the directory because WALA won't create it for you.

Please make sure you're checking your and configuration files first. Make sure all properties are set correctly such as the java, output, dot_exe, and pdfview_exe paths. If all correctly configured you'll see the a PDF file representing the type hierarchy. 

Hope this post will help you. If you find another problem or you find this post help your problem, please leave a comment below. See you in my next post.

No comments:

Post a Comment

Tips: How to ssh to your Digitalocean server without password

If you are tired of being asked for a password when accessing your remote droplet servers in Digitalocean, you might consider adding an rsa ...