JPad 1.06 Adds JPad.Functions for Running Console Commands

JPad now provides a JPad class to provide users with handy functions.
This includes functions for:

  • Running Terminal Commands
  • Caching
  • Writing out Objects to CSV files

For example running a command, capturing it’s output and reporting back the result as a string can be achieved using the cmd function:

Console Output

Read the help section for more details.

We also added some help for adding your own jar files to jpad. This has been tested on windows, we have a rough solution for the mac/linux but we will be improving it shortly.

JPad 1.05 Allows Uploading Code Runs

Ever wanted to share a problem with a colleague. A piece of java code that’s giving some strange result. Well we’ve added the ability to upload .jpad runs. You can see examples here.

Download the latest version.

This allows uploading java code aswell as the result of running that code to the website, where your friend can then view your problem or download and run it themselves.

Uploading works like this:

Help documentation on uploading is available here. If you have any problems etc. please let us know.

JPad Java Scratchpad 1.04 Released

New Features:

  • Improved error reports. Console and HTML improved, shows stack to user level code
  • Lighter text for highlighting error lines
  • bugfix to make sure we save currently opened docs on shutdown

jpad-java-compilation-error

Future Work

These additions were based on feedback from users on our forum:
http://jpad.io/b/forums/topic/feature-requests/ If you have ideas bug reports, ideas or suggestions please register and let us know.

Some requests people have already made include:

  • syntax highlighting
  • code upload similar to jsfiddle
  • code autocomplete / intellisense

We have also open sourced our examples on github, pull requests are definitely welcome.

 

What about the official JShell REPL in Java 9?

A user asked me “Are you familiar with the REPL in Java 9?  You should leverage it”. I want to lay out why I don’t.

To me a JEP is doesn’t yet feel like the right place for what I want to do. Yes, I have a bit of a REPL but I consider it just one facet. Most java people love GUIs, I see JPad as an environment to quickly run java code and to visualise it in many ways. To achieve this I want:

 

  1. To take an opinionated approach to what libraries are automatically  included (guava/apache,lombok..). Reducing the code clutter.
  2. To provide an opinionated output format (Everything is a table and shows as HTML).
  3. To then allow other people to add output format extensions as they see fit. For example I added one that displays the last “table” as a jfreechart. There’s no reason this couldn’t expand to javascript chart exports and any other type of visualization that anyone wants to add.

java-table-dump-chart-visualization-2

I think a JEP conflicts with taking quick opinionated approaches, I realise there are reasons for this, backwards compatibility etc. but that’s not something I think is important right now. If once people show interest and a load of visualizations and toString()/console outputs were added, then would be the time to consider canonical representations I think and where a JEP would be good.

That’s my 2 cents anyway :)