jscc

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

Лицензия

Лицензия

Группа

Группа

com.javax0
Идентификатор

Идентификатор

jscc
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

jscc
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Ссылка на сайт

Ссылка на сайт

http://maven.apache.org
Система контроля версий

Система контроля версий

https://github.com/verhas/jscc

Скачать jscc

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.javax0/jscc/ -->
<dependency>
    <groupId>com.javax0</groupId>
    <artifactId>jscc</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.javax0/jscc/
implementation 'com.javax0:jscc:1.0.1'
// https://jarcasting.com/artifacts/com.javax0/jscc/
implementation ("com.javax0:jscc:1.0.1")
'com.javax0:jscc:jar:1.0.1'
<dependency org="com.javax0" name="jscc" rev="1.0.1">
  <artifact name="jscc" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.javax0', module='jscc', version='1.0.1')
)
libraryDependencies += "com.javax0" % "jscc" % "1.0.1"
[com.javax0/jscc "1.0.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.5

test (2)

Идентификатор библиотеки Тип Версия
ch.qos.logback : logback-classic jar 1.0.13
junit : junit jar 4.11

Модули Проекта

Данный проект не имеет модулей.

jscc

A very simple Java source compiler code based on the javac provided by the JDK. The API built into the Java runtime is complex because it is designed to handle several input (Java source code) and output (generated byte code) reading and writing possibilities. This needs the implementation of complex classes that provide the source code and can store the generated byte code.

To ease the burden this library implements these classes along with a class loader to handle the simple case when you want to compile Java source available during run-time in String objects and you want to load the compiled classes instead generating .class files.

The library also implements a facade to provide a simple API.

Usage

import com.javax0.jscc.Compiler;

...

// create a new compiler
Compiler compiler = new Compiler();
// compile and load the class providing source code and
// fully qualified class name
Class<?> newClass = compiler.compile(sourceCode, className);

Using the class you can use the standard JDK way to get a new instance of the class calling

// get a new instance
Object object = newClass.newInstance();

For more information read the JavaDoc documentation of the project. This may be needed in case you want to handle source code that contains error, or you want to compile a class that needs special class loader.

This project was developed primarily to support the djcproxy library.

Maven Dependency

		<dependency>
			<groupId>com.javax0</groupId>
			<artifactId>jscc</artifactId>
			<version>1.0.1</version>
		</dependency>

Releases

  • 1.0.1 Handles source code that generate more than one class. For example classes that contain nested or inner classes, anonymous classes. Previous release did not handle the case and is not able to load the auxiliary classes.
  • 1.0.0 Initial release

Версии библиотеки

Версия
1.0.1
1.0.0