• Stars
    star
    269
  • Rank 152,662 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Utility class to compile java source code in memory

Update 09/22/2017: I've been silent for long time (I'm into Golang lately hence putting Java aside) despite the fact that there are lots of interests to make this mini tool better. I'll kick off my effort to improve this tool from now on by reviewing outstanding issues and PRs

InMemoryJavaCompiler Build Status codecov FOSSA Status

Samples with utility classes to compile java source code in memory

After taking huge effort to look for example on the internet and found nothing work. I decided to create a very simple version.

Note: Please make sure you use JDK in your runtime

E.g.:

StringBuilder sourceCode = new StringBuilder();
sourceCode.append("package org.mdkt;\n");
sourceCode.append("public class HelloClass {\n");
sourceCode.append("   public String hello() { return \"hello\"; }");
sourceCode.append("}");

Class<?> helloClass = InMemoryJavaCompiler.newInstance().compile("org.mdkt.HelloClass", sourceCode.toString());

If you are looking for more examples, please look at unit tests in the src/test/java folder

Artifact is pushed to Sonatype OSS Releases Repository

https://oss.sonatype.org/content/repositories/releases/

Maven dependency:

<dependency>
    <groupId>org.mdkt.compiler</groupId>
    <artifactId>InMemoryJavaCompiler</artifactId>
    <version>1.3.0</version>
</dependency>

License

FOSSA Status

More Repositories

1

erling

AMF Implementation written in Erlang
Erlang
13
star
2

jwt-tools

A command line program that offer number of tools for JWT using JWS and JWE
Go
4
star
3

riak-webui

Web UI for Riak, provide basic functionalities
Erlang
3
star
4

aws-rds-oracle

Terraform templates for AWS RDS
HCL
2
star
5

solr-eclipse

Setup Apache Solr project in Eclipse
2
star
6

gwt-tipsy

Tooltips widget for GWT
Java
2
star
7

zotonic

This is the official git repo for Zotonic, the Erlang CMS. It is updated periodically from Zotonic's authoritative Mercurial repository at http://code.google.com/p/zotonic
Erlang
2
star
8

cloudformation-terraform

Convert WP cloudformation template to Terraform template
HCL
2
star
9

filterdatagrid

ActionScript
1
star
10

shoppingapp

Simple shopping cart application for Google App Engine
Java
1
star
11

ejb3-persistence

1
star
12

gauge-java-bridge

Example using Gauge and Java to enable multiple languages support
Java
1
star
13

airy

Lightweight persistent framework for Adobe Air development with SQLite using annotations and DAO pattern
1
star
14

Applescripts

Some of useful applescripts
1
star
15

PDelete

Applescript util to delete files permanently in Finder
1
star
16

erlang-oauth-tests

Test code for erlang-oauth
Erlang
1
star
17

terraform-quorum-ignite

A Terraform module that bootstraps resources in order to run a Quorum network from scratch
HCL
1
star
18

AnyEvent-Riak

Modified version of AnyEvent-Riak 0.01 as not full support RIAK 0.9.1 REST API specs
Perl
1
star
19

erlang-oauth-examples

Example client/server code for erlang-oauth
Erlang
1
star
20

mail-dist

Mail forwarding to individual based on distribution list. GWT + GAE + Spring + Spring Security
Java
1
star