I'm debugging a Java (Android) application in Eclipse Indigo. In the debug perspective, if I'm stopped at a breakpoint, when I hover over a variable to see its value it displays a blank, white box (where I assume the variable's value is supposed to appear?) but with no content. It does not seem to matter what kind of a variable it is, local or class-scope, static or instance, the box is just as blank.
I can see the variables I need to see in the variables tab of the debugger perspective, but it would be a lot more convenient to see them by hovering.
In Preferences>Java>Editor>Hovers I've tried it with both Variable Values and Combined Hover with no improvement. I'm running on Windows 7, if that matters.
N.B. I have read this thread: Eclipse: Hover broken in debug perspective
Try to hit the restore defaults as described in Eclipse: Hover broken in debug perspective. Make sure to stop your debug run and restart.
You might also check Eclipse's Debug view documentation.
Try refactoring a package in your project then trying it again.
Could also be a bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=357127
Which version are you using?
I am seeing the same thing on Ubuntu. I am using the program VcXSrv on my Windows 10 system to get program windows from Ubuntu.
I had to turn off The 'Native opengl' option in the XLauncher when starting VcXSrv to get the hover text to appear.
I have tried to use breakpoint in the same way we use break point in Visual Studio or Netbeans, we simply mark the break point and when statement executes, the breakpoint highlights and we can see the values in respective data structure or variable using breakpoint explore.
As far as i have used eclipse, i have found break point is there too, but it is not in that way, means on runtime it does not pick the respective point and neither i can see values nor the application works perfectly while doing that. Is it not possible in eclipse or some tool is required, or i am wrong, please guide.
Ctrl+Shift+B while on the line.
Double click on the left most bar in Editor View.
Right click > Toggle Breakpoints on the left most bar in Editor View.
put a breakpoint at you code line you want,
then right click on project-> debug as -> android application
then go to window menu -> show view -> other... -> debug
or as show bellow
You must set a breakpoint and run the application in debug mode.
You have to launch application in Debug Mode. You can find Debug button left to Run button. It has bug as an icon.
Also could be useful: Setting up a Device for Development. It describes how to enable debugging on your device
I'm trying to use Breakpoints in Eclipse, but when I set them - nothing happens.
Really.
For example in MVS when the program reachs breakpoint it stopps and I can see variables.
How to use breakpoints in Eclipse in the same way?
you need to be debugging the program, click the little bug next to the run button instead of said run button
First select Debug perspective as:
Then set Breakpoints at places you want:
After that create a Debug configuration via Debug As->Debug Configurations... and then Debug as Android Application as shown below:
Then in Debug perspective you can trace/watch value of your desired variable by pressing F8:
That's it, you can also evaluate expressions through Expressions view. If it is not enabled select it from:
Window->Show View->Other->Debug->Expressions.
Sometimes I am doing simple fixes for rather huge Java application and I don't want to open Eclipse for this task. Eclipse starts long and since the project is build out of large number of subprojects, which are build anyway by Maven, it takes ages before Eclipse is usable (at least ages in impatient Java developer scale).
Almost everything I need can be done in Sublime Text editor, however one place where Eclipse shines is debugger. My workflow is: make a fix, then test it running application (on server) using debugger, to check if everything is ok.
So is there any Sublime plugin, or other non-IDE solution for easy debugging of Java application.
Note: I have seen this post - its pretty old, maybe there is something better.
You could look for a standalone Java Debugger like JDebugTool.
Or you could simply create an additional Eclipse workspace with only the bare minimal you need for remote debugging your application (just one project with all the source jars linked in).
This workspace will start considerably faster than the full blown.
I have never worked with a standalone debugger for Java and personally I tend to keep the number of tools I have to learn as low as possible and Eclipse's debugger is pretty good.
JDebug - A Java Debugging plugin for Sublime Text
Debugging is a painful art. The programmers(coders) know about it. Even perfectly written code may misbehave sometimes and it is difficult to identify the piece of code causing the issue just by log statements. So the only possible way to identify the issue is to do step by step debugging of the code dynamically. There are so many debugging tools available for Java, some are standalone and few are integrated within the IDE like Eclipse. In this article, I will show you how to debug java codes remotely using JDebug in Sublime Text.
Setting up Sublime Text JDebug plugin can be installed using Package Control or manually. I will show you how to install JDebug plugin using Package Control. If you haven’t install the Package Control, you can install packages by installing package control.
Once you have the package control installed, you should start Sublime Text. Open up the command palette from the Preferences --> Package Control menu and search for “Install Package”.
Now you can search for any package you like. In our case, we are going to search for the package “JDebug”.
Setting up App Server (Weblogic/Tomcat/any other) in debug mode
Pass -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 as JVM argument to server startup command. You can change the debug port from 8000 to anything you prefer.
Tomcat
Add/update the JAVA_OPTS env variable in catalina.bat or catalina.sh set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
Weblogic
Add/update the SAVE_JAVA_OPTIONS env variable in catalina.bat or catalina.sh set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
Setting up JDebug Setting up JDebug is very simple as it has only few settings to start with. You can copy and paste the default settings into user settings and update the following settings based on your environment.
workingdir - You need to set your current project directory like c:/worksapce/TestService (Windows) or /home/user/abc/workspace/TestService (Linux or Ubuntu)
commandline - Set the jdb command with arguments. If JDK/bin is not in your environment PATH then you need to specify full path to the jdb command. Also change the hostname and port in which the java application service is running and listening.
sourcepath - The path to the source file with in the project. For ant project it usually /src/ and for maven usually /src/main/java.
Breakpoints Ready to set the breakpoint?. Breakpoints are the way to inform the jvm to halt the execution at a particular point (line number or method in a class). When the execution halts, the application variables can be inspected.
Add a breakpoint using 'Toggle Breakpoint' menu option from context menu. Context menu can be accessible using right click. A circle icon will be placed on the line number gutter when a breakpoint is added
When the jvm hits the breakpoint during the execution, the gutter icon will be changed to 'pointer' to indicate that the breakpoint is hit.
Inspect Variables
Variables & expressions can be inspected using inline popup. Click on the variable or highlight the expression to evaluate/inspect inline.
Watch Expressions Expressions can be evaluated using the 'Add Expression' context menu. You can enter any valid expression to evaluate.
Enter the Expression
JDebug Variables It is interesting to watch the variables in the 'JDebug Variables' window. If a variable is complex object it will be displayed with '+' icon on gutter. These variables can be expanded further to get the additional details using 'Expand' context menu. The 'Expand' context menu will be enabled only in 'JDebug' variables window.
How to Continue?
The application execution can be continued using one of the following menu options
Step Over Continue execution to next line
Step Into Continue the execution into a method call
Step Out Step out of the current method and continue
Continue Continue to next breakpoint or till completion
enter image description here
I am trying to trouble shoot a JUnit. In the source code, I have set break point in two places: 1) in a line where a static member is initialized 2) the first line of one of the test cases.
The debugger stops in the static field initializing line. But it doesn't stop in the test case. No matter where I set the break point in the test case, the debugger doesn't stop there. I know for sure that the test case is executed as I can see the log messages that I have added appear in the log.
Any help would be greatly appreciated.
I am using Eclipse Galileo and JUnit4 launcher.
Fix could be as simple as clicking run/skip all breakpoints. Worked for me.
Make sure, under Run > Debug Configurations, that 'Stop in main' is selected, if applicable to your situation.
This could be related to one of the bugs in JDK 6 Update 14, as indicated in the release notes for JDK 6 update 15.
If this indeed turns out to be the issue, you should move to a higher version of the JDK (that's no guarantee though, since fixes have been released against 6u16, 6u18 and 7b1). The best bet is to use -XX:+UseParallelGC flag. Increasing the size of the minimum and maximum heap size, to delay the first GC, bring temporary relief.
By the way, use this bug report in Eclipse to track how others have been faring.
You might have accidentally skipped all break points in Eclipse toolbar. To fix this go to Eclipse -> Run -> Skip All Breakpoints.
Usually when this happens to me (rare but it does) means that the code being executed is different than the code in the editor. It will happen from time to time for Eclipse that the built classes and the code in editor are out of sync. When that happens I get all sort of weird debugger behavior (debugging empty lines, skipping lines of code etc).
Restarting Eclipse, clean all projects and rebuild everything usually clears things up. I had also the Maven plugins (older versions... had not had it for a while now) that had a tendency to do that too.
Otherwise it might be a bug, maybe the one Vineet stated,
Hope this helps
In my case the problem was that I hadn't Debug view open in Debug perspective, so:
1 - Be sure you have debug perspective opened:
2 - Be sure you have debug view opened:
Project -> Clean seemed to work for me on on JRE 8
In order to debugger work with remote, the java .class files must be complied along with debugging information. If "-g:none" option was passed to compiler then the class file will not have necessary information and hence debugger will not be able to match breakpoints on source code with that class in remote. Meanwhile, if jars/class files were obfuscated, then they also will not have any debug info. According to your responses, most probably this is not your case, but this info could be useful for others who face the same issue.
Remove all breakpoints and re-add them.
For JDK7, run->Debug Configurations, check "Keep JUnit running after a test run when debugging".
Happened to me once, when I had unchecked "Run > Build automatically" and forgot to re-check it.
Make sure you declare the package at the top.
In my groovy code this stops at breakpoints:
package Pkg1
import java.awt.event.ItemEvent;
isMule = false
class LineItem {
// Structure defining individual DB rows
public String ACCOUNT_CODE
public String ACCOUNT_DESC
...
This does not stop at breakpoints:
import java.awt.event.ItemEvent;
isMule = false
class LineItem {
// Structure defining individual DB rows
public String ACCOUNT_CODE
public String ACCOUNT_DESC
...
To remove the breakpoints:
Debug your class as a junit test
When your debugger stops, click the "breakpoints" tab next to "variables" and "expressions"
At the top right of the breakpoint tab, click the button with two 'X'
Stop the test, replace your breakpoint and run the debugger again
Also verify if breakpoints on other lines DO work, it may be a bug in the debugger. I have had a problem with the Eclipse debugger where putting a breakpoint on a boolean assignment whose code was on the next line didn't work I reported this here, but putting it on the previous or next line did.
If nothing works-
Remove that Remote/Local Debug Configuration, and Create a new One.
Add the Source in Debug Configurations.
Another possible problem is that the debugger port may be blocked by the firewall. For example, I was using mule anypoint studio (v 5.4.3). The default debugger port is 6666. When a flow is executed, it would not stop at breakpoint. when I changed the port to another (e.g. 8099), it worked fine.
Go to Right click->Debug Configuration and check if too many debug instances are created.
My issue was resolved when i deleted multiple debug instances from configuration and freshly started debugging.
If you are on Eclipse,
Right click on your project folder under "Package Explorer".
Goto Source -> Clean up and choose your project.
This will cleanup any mess and your break-point should work now.
Creating a new workspace worked for me.
In my case I had multiple projects in same workspace. The java file I was trying to debug was present in more than one projects with same package.
I didn't need the other project, so simply closed unrelated projects (or remove the file from unrelated project).
One additional comment regarding Vineet Reynolds answer.
I found out that I had to set -XX:+UseParallelGC in eclipse.ini
I setup the virtual machine (vm) arguments as follows
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=256M
-XX:MaxPermSize=512M
that solved the issue.
It happened to me when I had several project, I realized that I created a spring boot configuration of a project B from a project A (I clicked on Duplicate and change the parameter to have a config for the project B) and in that case I haven't the debug mode so I removed this config and I created directly a new one by clicking New in Spring Boot App
This is what works for me:
I had to put my local server address in the PHP Server configuration like this:
Note: that address, is the one I configure in my Apache .conf file.
Note: the only breakpoint that was working was the 'Break at first line', after that, the breakpoints didn't work.
Note: check your xdebug properties in your php.ini file, and remove any you think is not required.