タグ

Javaとcompilerに関するyassのブックマーク (2)

  • Home - Codehaus

    What is Janino? Janino is a super-small, super-fast Java™ compiler. Not only can it compile a set of source files to a set of class files like the JAVAC tool, but also can it compile a Java™ expression, block, class body or source file in memory, load the bytecode and execute it directly in the same JVM. Janino is not intended to be a development tool, but an embedded compiler for run-time compila

    yass
    yass 2013/10/14
    " Janino is a super-small, super-fast Java™ compiler. Not only can it compile a set of source files to a set of class files like the JAVAC tool, but also can it compile a Java™ expression, block, class body or source file in memory, load the bytecode and execute it directly in the same JVM. "
  • javax.tools パッケージを使って Java コードをダイナミックにコンパイル! - 倭マン's BLOG

    以前から javax.tools パッケージって気になってたんですが、それを使ったサンプルを見つけたのでちょっと試してみることに。 javax.tools パッケージのクラスを使うと、Java クラスをダイナミックに生成することができるそうです。 ここでいう“ダイナミックに”とは「内容が Java コードの java.lang.String オブジェクトから Java クラスファイルを生成できる」という意味です*1。 ただ、API を使っていると、どことなく「$JAVA_HOME/bin/javac.exe」をラップした API って感じが漂ってくるので(実際にそういう実装なのかは知りませんが)、何か何処かぎこちない気もしないでもない(こともない*2) まぁ、ともかくサンプルを動かしてみましょう。 ちなみに JDK 6 必須です。 参考 URL JavaDoc 「Package javax

    javax.tools パッケージを使って Java コードをダイナミックにコンパイル! - 倭マン's BLOG
  • 1