diff --git a/dynamicjava/.gitignore b/dynamicjava/.gitignore index af2038d7e..f37492193 100644 --- a/dynamicjava/.gitignore +++ b/dynamicjava/.gitignore @@ -1,5 +1,5 @@ classes/ -*.jar +dynamicjava*.jar # Generated code src/edu/rice/cs/dynamicjava/symbol/type/* diff --git a/dynamicjava/README.md b/dynamicjava/README.md new file mode 100644 index 000000000..982288c0e --- /dev/null +++ b/dynamicjava/README.md @@ -0,0 +1,41 @@ +# DynamicJava + +DynamicJava is a REPL for Java code. + +## IPython Kernel + +DynamicJava includes a built-in [IPython](http://ipython.org) kernel. The kernel enables execution of Java code in the IPython terminal application as well as in its web based [notebook interface](http://ipython.org/notebook.html). + +### Prerequisites + +1. Install IPython. It can be installed using `pip` with `pip install ipython` or through your package manager. + +2. Create a new IPython profile for DynamicJava. Run `ipython profile create dynamicjava`. This will create a new IPython profile in `.ipython/profile_dynamicjava`. + +3. Configure the new profile to run the DynamicJava kernel. Copy the following lines into `.ipython/profile_dynamicjava/ipython_config.py`, replacing `DYNAMICJAVA_PATH` with the file path of `dynamicjava.jar`. Any additional arguments to the JVM should be passed here. + + ``` + c.KernelManager.kernel_cmd = [ + "java", + "-jar", "DYNAMICJAVA_PATH", + "-kernel", "{connection_file}" + ] + c.Session.key = b'' + c.Session.keyfile = b'' + ``` + +4. (Optional) To debug the kernel while it is running, add the following line to the `kernel_cmd` list. + + ``` + "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044", + ``` + + To use the debugger, follow the instructions to configure remote debugging for your IDE ([Eclipse](http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-remotejava_launch_config.htm), [IntelliJ](https://www.jetbrains.com/idea/help/run-debug-configuration-remote.html)) + +5. Configure the IPython Notebook Java syntax highlighting. Copy the files in `profile/static/custom/` to `.ipython/profile_dynamicjava/static/custom/`. + +### Building and Running + +* To build the kernel, run `ant jar`. +* The IPython console frontend can be run with `ipython console --profile dynamicjava`. +* To run the web interface, run `ipython notebook --profile dynamicjava`. diff --git a/dynamicjava/build.xml b/dynamicjava/build.xml index 9708ab4f6..bc412c9c0 100644 --- a/dynamicjava/build.xml +++ b/dynamicjava/build.xml @@ -32,7 +32,6 @@ - @@ -76,8 +75,6 @@ - - @@ -165,15 +162,22 @@ - - - - + + + + + - - - - + + + + + + @@ -191,30 +195,7 @@ - - - - - - - - - - - - - - - - - - - - - - + @@ -223,7 +204,7 @@ description="Compile all source files (after generating the source)"> - + @@ -235,8 +216,8 @@ - @@ -320,15 +301,7 @@ - - - - - - - - + @@ -502,8 +475,8 @@ - - + + @@ -515,10 +488,7 @@ - - - + @@ -843,16 +813,15 @@ - - + - + - + @@ -877,39 +846,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -994,13 +930,7 @@ - - - - + - + @@ -26,22 +26,22 @@ - + - + - + - + - + @@ -51,17 +51,17 @@ - + - - - + + + - + @@ -89,7 +89,7 @@ - + @@ -129,36 +129,36 @@ - - + + - + - + - + - + - + - + - + - + - + - + @@ -187,10 +187,10 @@ - + - - + + @@ -205,15 +205,15 @@ - - + + - + @@ -224,13 +224,13 @@ - - + + - + @@ -251,15 +251,15 @@ - + - - + + @@ -271,12 +271,12 @@ - + - + @@ -294,7 +294,7 @@ - + @@ -303,7 +303,7 @@ - + @@ -316,9 +316,9 @@ - + - + @@ -328,10 +328,10 @@ - + - + @@ -340,10 +340,10 @@ - + - - + + - - @@ -393,7 +393,7 @@ - @@ -409,7 +409,7 @@ - + @@ -417,7 +417,7 @@ - + @@ -433,17 +433,17 @@ - - - - - - - - + @@ -499,18 +499,18 @@ - + - + - + @@ -529,15 +529,15 @@ - + - + - + - + @@ -546,15 +546,15 @@ - + - + @@ -564,8 +564,8 @@ - - @@ -594,8 +594,8 @@ - - @@ -616,7 +616,7 @@ - + @@ -630,7 +630,7 @@ - + @@ -646,19 +646,19 @@ - + - + - + @@ -670,7 +670,7 @@ - + @@ -682,7 +682,7 @@ - + @@ -698,7 +698,7 @@ - + @@ -719,8 +719,8 @@ - - @@ -734,7 +734,7 @@ - + @@ -754,10 +754,10 @@ - - + + @@ -775,7 +775,7 @@ - + @@ -786,13 +786,13 @@ - + - + @@ -808,7 +808,7 @@ - + @@ -819,13 +819,13 @@ - + - + @@ -841,7 +841,7 @@ - + @@ -852,30 +852,30 @@ - + - - + + - + - + - - + + @@ -883,7 +883,7 @@ - + @@ -891,7 +891,7 @@ - + @@ -917,7 +917,7 @@ - + @@ -927,7 +927,7 @@ - + @@ -940,7 +940,7 @@ - + @@ -957,7 +957,7 @@ - + - -