Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.io.*;
  2. import java.net.*;
  3.  
  4. /**
  5.  * Dreck
  6.  * Date: 24.10.2014
  7.  * @author Oliver Jessner, Andreas Scheicher
  8.  * @email oliver.jessner@gmx.net
  9.  */
  10. public class Main {
  11.  
  12.     public static void main(String [] args) {
  13.         Application app = new Application();
  14.         File file = new File("//Users/oliver//Documents//workspace//Aufgabe1//bin//Animal.class");
  15.  
  16.         try {
  17.             URL url = file.toURI().toURL();
  18.             URLClassLoader cl = new URLClassLoader(new URL[]{url});
  19.             Class<?> cls = cl.loadClass("Animal");
  20.            
  21.             app.reconstruct(cls, new PrintStream(new File("/Users/oliver/new.java")));         
  22.         } catch (MalformedURLException e) {
  23.             e.printStackTrace();
  24.         } catch (ClassNotFoundException e) {
  25.             e.printStackTrace();
  26.         } catch (FileNotFoundException e){
  27.             e.printStackTrace();
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement