Вопрос

I'm using the eclipse jdt compiler to compile java code. Class files are being generated, but the class name within them contains the prefix "src". For example, when compiling com.pkg.ClassName, the name of the generated class file is src.com.pkg.ClassName

Here's the code:

            for (Object classFileObject : compilationUnitDeclaration.scope.referenceContext.compilationResult.compiledTypes
                .values()) {
                classFiles.add((ClassFile) classFileObject);
            }

When building the project, we put all the sources under the "src" folder, but the generated class files should not contain this src as a prefix.

Это было полезно?

Решение

Corrected it.I had an exception when setting the classpath which caused subsequently for the src folder not to be recognized correctly.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top