public class JavaStringCompiler extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
(专用程序包) JavaCompiler |
compiler |
(专用程序包) StandardJavaFileManager |
stdManager |
| 构造器和说明 |
|---|
JavaStringCompiler() |
JavaCompiler compiler
StandardJavaFileManager stdManager
public Map<String,byte[]> compile(String fileName, String source) throws IOException
fileName - Java file name, e.g. "Test.java"source - The source code as String.IOException - If compile error.public Class<?> loadClass(String name, Map<String,byte[]> classBytes) throws ClassNotFoundException, IOException
name - Full class name.classBytes - Compiled results as a Map.ClassNotFoundException - If class not found.IOException - If load error.Copyright © 2021 cn.huangxulin. All rights reserved.