Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly prototype Java code? [closed]

Interpreted languages are nice, I can write some quick, prototypical code (i.e. using an interactive shell) for the purpose of exploration before delving into production level code.

What is the best approach for this with Java? Currently I'm creating Maven projects with Eclipse, and exploring things in my test infrastructure using JUnit... but this is less then ideal.

like image 809
wulfgarpro Avatar asked Oct 03 '12 08:10

wulfgarpro


3 Answers

You can also check out Eclipse's Scrapbook Page:

Menu>File>New>Other>(search for)Scrapbook Page

like image 148
Maciej Dragan Avatar answered Oct 11 '22 05:10

Maciej Dragan


Why not use something like BeanShell ? It's a scripting solution for Java and offers a console-based interactive scripting environment.

Here's the quick start guide. Note that you can also start a BeanShell console from within Maven.

I've picked BeanShell here since it's the closest thing to Java, but interactive. You could pick another console-based JVM language such as Scala, Jython etc. They're more removed from standard Java since they're different languages, but still offer interoperability with your standard Java components.

like image 45
Brian Agnew Avatar answered Oct 11 '22 06:10

Brian Agnew


You might want to try out JRebel for quick code tweaking. Or if you are into web development, check Play framework.

http://zeroturnaround.com/software/jrebel/

http://www.playframework.org/

like image 1
Petteri H Avatar answered Oct 11 '22 07:10

Petteri H