Giter Site home page Giter Site logo

compilation-toolbox's People

Watchers

 avatar

compilation-toolbox's Issues

where is the bytecode

i need the bytecode of my class that compiled by this compiler
plz plz plz help

if god knows programming...

Original issue reported on code.google.com by [email protected] on 19 Aug 2013 at 10:09

javaSourceCompiler.persistCompiledClasses( compilationUnit ) doesn't create an actual file

What steps will reproduce the problem?
1. Compile a class without exceptions
2. Use that same compiler to persist your compilation unit to disk
3. Trace through the logic for the temporary files, etc
4. From terminal window, notice that directory and file aren't there
5. From within java code, the .exists() method returns false

Approximate code:
    String src = ...;
    String target = "pkg.MyClass";
    JavaSourceCompiler javaSourceCompiler = new JavaSourceCompilerImpl();
    JavaSourceCompiler.CompilationUnit compilationUnit = javaSourceCompiler.createCompilationUnit();
    // Setup class path
    Collection<String> paths = getActiveClassPathEntries( optContextClass );
    compilationUnit.addClassPathEntries( paths );
    // Compile, no more exceptions
    compilationUnit.addJavaSource( target, src );
    ClassLoader classLoader = javaSourceCompiler.compile(compilationUnit);
    Class myClass = classLoader.loadClass( target );
    // Persist!?
    javaSourceCompiler.persistCompiledClasses( compilationUnit );

    // Debug code inspired by JavaSourceCompilerImpl
    JavaFileObjectRegistry registry = compilationUnit.getRegistry();
    log.info( "Registry: \"" + registry + "\"" );
    File classOutputDirectory = compilationUnit.getOutputClassDirectory();
    log.info( "Class file should be under: \"" + classOutputDirectory + "\"" );
    Collection<JavaFileObject> classFiles = registry.get(JavaFileObject.Kind.CLASS);
    // Finds 1 class
    log.info( "Found " + classFiles.size() + " class file(s)" );
    int i = 0;
    for (JavaFileObject javaFileObject : classFiles ) {
      log.info( "\t#" + i + " javaFileObject = \"" + javaFileObject + "\"" );
      URI url = javaFileObject.toUri();
      log.info( "\t#" + i + " jfo URI = \"" + url + "\"" );
      String internalName = javaFileObject.getName().substring(1);
      log.info( "\t#" + i + " internal name = \"" + internalName + "\"" );
      File compiledClassFile = new File(classOutputDirectory, internalName);
      // This path doesn't exist
      log.info( "\t#" + i + " compiledClassFile = \"" + compiledClassFile + "\"" );
      // Exists returns FALSE
      log.info( "\t#" + i + " exists = " + compiledClassFile.exists() );
      log.info( "\t#" + i + " absolute = " + compiledClassFile.getAbsolutePath() );
      log.info( "\t#" + i + " canonical = " + compiledClassFile.getCanonicalPath() );
      log.info( "\t#" + i + " parent = \"" + compiledClassFile.getParentFile() + "\"" );
      i++;
    }



What is the expected output? What do you see instead?
File

What version of the product are you using? On what operating system?
0.3.1

Please provide any additional information below.
It's odd.
I don't see errors, but no file nor directory either.

Original issue reported on code.google.com by [email protected] on 8 Aug 2013 at 6:55

Adding multiple classpaths does not work on Windows

What steps will reproduce the problem?
Adding multiple classpath entries using addClassPathEntry on Windows does not 
work because the entries are connected by colon ":". On Windows, however, it 
should be connected by semicolon ";" as the colon is already used in the path 
(e.g. "c:\Project\...")

What version of the product are you using? On what operating system?
Win7 x64

The problem is located in JavaSourceCompilerImpl.addClassPath

Original issue reported on code.google.com by [email protected] on 20 Nov 2012 at 5:33

Package does not exist error

What steps will reproduce the problem?
1. Load external dependency
2. Compile code

What is the expected output? What do you see instead?
Expected output is a completed compile, instead I'm getting package does not 
exist.
See: https://dl.dropbox.com/u/44002922/Capture1.PNG

What version of the product are you using? On what operating system?
Windows 7, compilation-toolbox 0.3.1, Java 6

Please provide any additional information below.
Here is my code, any help would be appreciated.
http://pastie.org/5407048
I suspect this is an error on my end, but for the life of me cannot figure out 
the problem. Thank you in advance.



Original issue reported on code.google.com by [email protected] on 20 Nov 2012 at 5:21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.