JavaBot icon indicating copy to clipboard operation
JavaBot copied to clipboard

Execute Java code instead of groovy: !!eval-javac:

Open Unihedro opened this issue 11 years ago • 5 comments

Compiles and runs code, be it Java statements or Java classes.

!!eval-javac: (code)

We need this because Groovy isn't of Java syntax, plus it doesn't support JDK8. Using Java code execution will allow running code of the same Java compliance level as the runtime, using JavaCompiler.

Plus, this will be a great opportunity for me to take a break from Vincentyification/JChatExchange, so I'm going to self-assign this and work on it.


  • [ ] Execute Java code command: !!eval-javac:
  • [ ] Learn a command from the user: !!learn
  • [ ] Execute code from online

Unihedro avatar Nov 27 '14 16:11 Unihedro

might be interesting to integrate code compiled like this to a !!learn command for later use

Vogel612 avatar Nov 27 '14 17:11 Vogel612

Good idea, I like that a lot. Following that we should also establish running code from gists, pastebin and pastie. For now I'll do it in the following order:

  1. Execute Java code command: !!eval-javac:
  2. Learn a command from the user: !!learn
  3. Execute code from online

Which I also added as a checklist to the main post.

Unihedro avatar Nov 28 '14 05:11 Unihedro

This will deprecate the old !!java-command, right?

Vogel612 avatar Dec 01 '14 10:12 Vogel612

It never worked properly anyway. I've never been able to compile a class.

Unihedro avatar Dec 01 '14 10:12 Unihedro

Then I'll just kick that out in my current working branch ;)

Vogel612 avatar Dec 01 '14 15:12 Vogel612