I would recommend implementing some sort of Java parser written in JavaScript into your game, then coding a simple ide (some menus and a command line) to surround it. I would use ANTLR, which is a general language parser which you can use to translate Java into Javascript to have it run in Unity. Another option is GWT, which allows you to write applications in Java and execute them in JavaScript. Hope you can use one of these two options, and good luck with your game.
EDIT: You could also literally start another application from within Unity if that would be useful to you. Something like the following on Mac:
import System.IO;
function Start() {
var info:FileInfo = new FileInfo("/Applications/TextEdit.app/Contents/MacOS/TextEdit");
System.Diagnostics.Process.Start(info.FullName);
}
Or this on Windows:
import System.Diagnostics;
var fileLocation: String = "C:/Program Files/Skype/Phone/Skype.exe";
var test:Process = new Process();
test.StartInfo.FileName = fileLocation;
function Start() {
test.Start();
UnityEngine.Debug.Log("we got here!");
}