you can also create a scrapbook page (a .jpage) file and type your code in there. then click run. it looked slightly more convenient when i tried it.
like others say, you use the display view. but for some variants of eclipse, it may be named differently. for instance, if you are using spring tool suite as your eclipse, the view name corresponding to display view is debug shell.
complementing all the amazing answers, for mac users is cmd + d
you can use the 'display' view to evaluate expressions in eclipse.
look under the debug list of views. it is a standard par part of the java tooling so you don't need a plugin
i'm currently using eclipse photon (v4.8.0). eclipse changed the "display" view name to "debug shell view". here, you can execute commands on-the-fly.
i believe that what you're looking for are "watch expressions". just mark the piece of code in the source code view, right-click and select "watch".
use the debug shell! coming from node, i was pretty used to being able to mess with my env variables at any time using
node --inspect in chrome, and so it was imperative for me to find the same experience in eclipse without having to use jdb.
to open the debug shell, go to window → show view → debug shell
after you write the code you wish to run, simply highlight it, right click, and execute (⌘u also works)
select the line and press
this will give the result in a popup.
you can use the display view to execute commands while debugging. you can find this in window -> show view -> display
use the display view, or a bit quicker: highlight the code you want to run and right-click/execute or ctrl+u.
- How to execute some function in eclipse while debugging a java program?
- how do i take step reverse while doing debugging in eclipse ide for java
- How to execute java program from eclipse windows to Linux server
- How to execute a java program from another java program in eclipse
- How can I collect some hardware profile data during the execution of the Java program with eclipse and JVM monitor?
- How to execute some action in an external program through java code
- How can I compile a Java program in Eclipse without running it?
- Moving the instruction pointer while debugging Java in Eclipse
- How to Debug JUnit tests similar to a regular Java program within Eclipse
- How to skip loops while debugging Java code?
- Catching exceptions as an expression while debugging Java in Eclipse IDE
- how do you make getResourceAsStream work while debugging Java in Eclipse?
- How to terminate android application while debugging in eclipse
- How to publish a message while receiving on a Java MQTT client using Eclipse Paho
- Facing issues while running remote java program through RSE plugin in Eclipse
- How Exclude some files from Eclipse Java EE Web Application project Deployment Assembly
- Unable to use F5 to step into function while debugging on Eclipse
- How to debug Groovy code via the remote Java application debugging in Eclipse
- how to access a text file while debugging with eclipse CDT
- How to disable eclipse switching to debug view while debugging
- How to change value of a HashMap while debugging in eclipse
- How can I get a Java program in Eclipse to use multiple processing cores?
- How eclipse execute java code when there are compile errors
- Eclipse: How to force execute a particular java statement while debugging?
- how to show result of java program in console output in eclipse using log4j logger?
- How debugging is much easier in eclipse for java programs?
- How to attach a process in eclipse for debugging of muiti-process program
- How to execute java source in Eclipse
- How to fix eclipse spinning CPU while debugging on tomcat server
- How to gracefully stop a java main program running inside eclipse
More Query from same tag
- How to import classes defined in other packages in same project in eclipse?
- eclipse- "show in project explorer" option is not working
- What am I doing wrong here? I made another package in the same project called img and put a png file in there, but I get this error
- How to attach source code of Java EE in Eclipse?
- TFS Builds with Java and Eclipse
- Error while building Spring MVC project
- BirtDateTime.addDay returns wrong year around new years eve
- Is it possible for an Eclipse plugin to be both Headless and make contributions to the UI?
- How is NoClassDefFoundError thrown
- Keylogger or Knowing the mostly pressed button in Android app (Eclipse)
- refactoring variables access automatically
- Is it possible to use the same package and class name in Eclipse plugins with different ID?
- Error in deploying project with eclipse and tomcat
- Collision detection not working in 2d android
- Eclipse Linux stock "Hello World"-app doesn't run
- PMD and Findbugs Validations
- Android on Eclipse: no Wi-Fi 3G or Edge connection detected
- How to create String Format template to generate Json for Eclipse autogenerated toString
- Get help in Eclipse on Java keywords
- Does eclipse have a free Java refactoring plugin that can extract a class including both fields and methods?
- What are P2 touchpoints, can they be used to run external scripts?
- Connect4 Java in Eclipse
- The type org.springframework.beans.factory.support.BeanNameGenerator cannot be resolved Without Maven
- How can I bind a key to an automatic timestamp in Eclipse?
- Coldfusion Builder Plugin doesn't load
- How do I use last.fm api in java eclipse?
- maven: Plugin execution not covered by lifecycle configuration
- -Dmaven.multiModuleProjectDirectory system propery is not set
- Converting Strings to Uppercase with charAt
- What's a good Lua IDE for linux?