Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1000401 // hotwire (OUTDATED)

JavaX fragment (include)

1  
  // compile JavaX source, load classes & return main class
2  
  // src can be a snippet ID or actual source code
3  
  
4  
  // requires class _x18
5  
  
6  
  static Class<?> hotwire(String src) tex {
7  
    new List<File> libraries;
8  
    File srcDir = _x18.transpileMain(src, libraries);
9  
    
10  
    File classesDir = _x18.TempDirMaker_make();
11  
    String javacOutput = _x18.compileJava(srcDir, libraries, classesDir);
12  
    System.out.println(javacOutput);
13  
    URL[] urls = {classesDir.toURI().toURL()};
14  
    
15  
    // make class loader
16  
    URLClassLoader classLoader = new URLClassLoader(urls);
17  
18  
    // load & return main class
19  
    return classLoader.loadClass("main");
20  
  }

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

Comments [hide]

ID Author/Program Comment Date
787 #1000604 (pitcher) 2015-08-18 00:07:22

add comment

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: 799 / 727
Referenced in: [show references]