문제

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