17
votes

I am using Eclipse 3.4.2 with the latest GWT. The IDE doesn't even switch to Debug Perspective automatically.

10
Would it hurt to give a bit more info ???mP.
Actually, I am just trying the StockWatcher example from GWT tutorial. It runs perfectly with Run and Debug. But, it just doesn't break at Debug mode. I tested running a pure Hello World kind of Java application. I have no problem setting the break point. Is it possible that my version of Google eclipse plugin is too old for eclipse? But, I just downloaded latest from both.Cosmo
Having the same problem, too. I am using Eclipse Juno Version 4.2.0 and JDK 1.7.0_13. Both downloaded today, and I am stuck at exactly the same point in the same sample application. I am using Windows 7 64 bit.Uooo
Having the same issue as well. I had it debugging fine for the longest time. Now, after no JDK or GWT changes, it does not stop at breakpoints.aglassman
It is good to know that I am not the only one. Java 1.7.0_25-b17 and GWT 2.3 (need to use the older one for this project)njfife

10 Answers

4
votes

I have found a different thread in groups discussing my problem.

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/a9b553a6df5da5b8/65298c48c32deac0?lnk=raot&pli=1

Basically, JDK 1.6.0_14 will not work with GWT in eclipse debug mode. Switching a different JDK will work.

3
votes

Do you launch your GWT application in hosted mode ?

You will spend most of your development time running your application in hosted mode, which means that you are interacting with your GWT application without it having been translated into JavaScript.
Anytime you edit, run, and debug applications from a Java integrated development environment (IDE), you are working in hosted mode.
When an application is running in hosted mode, the Java Virtual Machine (JVM) is actually executing the application code as compiled Java bytecode, using GWT plumbing to automate an embedded browser window.
This means that the debugging facilities of your IDE are available to debug both your client-side GWT code and any server-side Java code as well.


Tip: If you are using Eclipse, you can also create a launch configuration file when creating a new project with applicationCreator by using the -eclipse flag.

If you didn't use applicationCreator to create an application-specific hosted mode shell script, you can manually run the main class in com.google.gwt.dev.GWTShell found (depending on your OS) in gwt-dev-windows.jar, gwt-dev-linux.jar, or gwt-dev-mac.jar.

Important: If you are not using the generated <module>-shell script, be aware that in hosted mode, the GWT development shell looks for modules (and therefore client-side source) using the JVM's classpath. Make sure to add your source directories first in your classpath.


See also Debug in Hosted Mode

alt text
(source: googlecode.com)

2
votes

These days, it seems that GWT classic dev mode is no longer supported, or at least not recommended. It's been replaced by GWT super dev mode, which runs your code in Javascript, not on the JVM. This means that you debug in your browser, instead of in Eclipse. For example, I visited my site in Chrome, opened the developer tools, switched to the sources tab, and then looked under the sourcemaps folder to find all my Java classes. I can put breakpoints there, and the browser will stop when the Javascript equivalent is running. I can inspect the Javascript variables that roughly match my Java variables.

If you really prefer debugging in Eclipse, you can use the Super Dev Mode Debugger Eclipse plugin, but it's doing the same thing as the Chrome debugger. When I tried it out, I had to watch the video to get it working.

1
votes

I'm running 1.6.0_13 and still the debug doesn't work. It just doesn't hit the breakpoints. And more, the page shows up blank in hosted mode (except for the static content in the HTML file), but everything displays and works correctly when running on the browser.

java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)

1
votes

I had the same problem. In my case the problem was that I was using JRE instead of JDK. Setting JDK instead of JRE, solved my problem. I recommend reviewing the build configuration to see which one is being used.

0
votes

I want to confirm that Basically, JDK 1.6.0_14 will not work with GWT in eclipse debug mode. Switching a different JDK will work.

I installed JDK 1.6.0_13 and the eclipse debug perspective kicked in. Using eclipse 3.3.2

Thanks for the tip!

0
votes

Also confirming that the debugger does not work with 1.6.0_14. A downgrade to 1.6.0_13 solved my issue. Farinha, might you still have your java_home (or something similar) pointing to an install of 1.6.0_14 even though you have installed 1.6.0_13?

0
votes

Upgraded to jdk1.6.0_17 - Works fine

0
votes

Changing the JDK didn't help in my case, but I have finally found out what's wrong.

When moving from GWT 1.7 to 2.0 the old GWT classes will stay on the war ouput. They must be manually deleted in order for 2.0 to kick in.

0
votes

I was also following the StockWatcher guide on the GWT website and then got to the Debugging part of the tutorial and I could not get my breakpoints to trigger until I stumbled upon the SDBG plugin. I installed the plugin and followed the video and it worked!

My environment:

  • Eclipse Neon.1a Release (4.6.1)
  • JDK 1.7.0_80
  • GWT SDK 2.7.0

Additional Notes:

Make sure to make a Debug Configuration and use com.google.gwt.dev.DevMode as your Main class.