Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse plugin for fast java code testing

I wonder if there is a plugin for Eclipse that can execute some java expression?

For example i want to find proper pattern of SimpleDateFormat and i could create new class within which i then initialize several formatters and after compiling and execution i'll see a result, but instead that i want to be able to write those formatters in this plugin view and see their result after execution without new class.

Thanks

like image 858
little_b Avatar asked Jan 14 '11 10:01

little_b


People also ask

Which plugin is needed for Java development in Eclipse?

Bazel Eclipse Feature provides Bazel integration for Eclipse for Java projects. It uses the existing Java tooling (JDT) in Eclipse to provide developers with all the features that they expect ...

How do I test a method in Eclipse?

Press Alt+Shift+X,T to run the test (or right-click, Run As > JUnit Test). If you want to rerun the same test method, just press Ctrl+F11. For this to work, ensure that you've told Eclipse to always run the last launched application.

Are Eclipse plugins free?

Steps 2 Eclipse Plug-inDownload for Free. Available in English and French.


1 Answers

I use a scrapbook page.

To create one, go to File -> New -> Other -> Java -> Java Run/Debug -> Scrapbook Page. Type the statements e.g.

String text = new java.text.SimpleDateFormat("yyyy-MM-dd").format(new java.util.Date());
System.out.println(text);

Execute it, by highlighting the text (Ctrl+A) and then Ctrl+U.

The one thing I don't like, is that it doesn't allow import statements. You have to either type the fully qualified class name as above, or explicitly go into the Set imports menu and add classes you want to import.

like image 150
dogbane Avatar answered Oct 01 '22 12:10

dogbane