// compile JavaX source, load classes & return main class
// src can be a snippet ID or actual source code
// requires class _x18
static Class<?> hotwire(String src) tex {
new List<File> libraries;
File srcDir = _x18.transpileMain(src, libraries);
File classesDir = _x18.TempDirMaker_make();
String javacOutput = _x18.compileJava(srcDir, libraries, classesDir);
System.out.println(javacOutput);
URL[] urls = {classesDir.toURI().toURL()};
// make class loader
URLClassLoader classLoader = new URLClassLoader(urls);
// load & return main class
return classLoader.loadClass("main");
}download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
| ID | Author/Program | Comment | Date |
|---|---|---|---|
| 787 | #1000604 (pitcher) | 2015-08-18 00:07:22 |
| Snippet ID: | #1000401 |
| Snippet name: | hotwire (OUTDATED) |
| Eternal ID of this version: | #1000401/1 |
| Text MD5: | 6811cbe9ef0d988e2a85e95992ec2c84 |
| Author: | stefan |
| Category: | |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-08-23 17:43:39 |
| Source code size: | 667 bytes / 20 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 1487 / 1382 |
| Referenced in: | #1000631 - hotwire for x19+ (_javax) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |