Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyse jar and not java file #695

Closed
A-AFTAHI opened this issue Jul 11, 2018 · 8 comments
Closed

Analyse jar and not java file #695

A-AFTAHI opened this issue Jul 11, 2018 · 8 comments

Comments

@A-AFTAHI
Copy link

A-AFTAHI commented Jul 11, 2018

When i run spotbugs on jar files it works just fine but when i run it on standalone .java file, i get the following error:

Exception in thread "main" java.io.IOException: IOException while scanning codebases
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:282)
at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:401)
at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1187)
Caused by: edu.umd.cs.findbugs.classfile.ResourceNotFoundException: Resource not found: java/lang/Object.class
at edu.umd.cs.findbugs.classfile.impl.ClassPathImpl.lookupResource(ClassPathImpl.java:164)
at edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.build(ClassPathBuilder.java:282)
at edu.umd.cs.findbugs.FindBugs2.buildClassPath(FindBugs2.java:674)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:215)

@ThrawnCA
Copy link
Contributor

SpotBugs works on compiled files, not source files, for starters. How are you trying to execute it?

@A-AFTAHI
Copy link
Author

I wanna use it to test mobile applications code quality. so i reverse the .apk to java files than i run the spotbugs on those files.

@ThrawnCA
Copy link
Contributor

How are you running it? Via Ant? Eclipse? Standalone? Can you paste the command that you're running?

@A-AFTAHI
Copy link
Author

i run it standalone : ./spotbugs -textui -xml:withMessages file.java

@ThrawnCA
Copy link
Contributor

As mentioned, can you try it on bytecode rather than Java source?

@A-AFTAHI
Copy link
Author

A-AFTAHI commented Jul 13, 2018 via email

@KengoTODA
Copy link
Member

I'll close this stale issue, please feel free to reopen.

@MohdRashid01
Copy link

I am having below issue please help me

As i want to generate xml reports into file
example findbugs.xml it should generate this with name

Error
findbugs -xml /home/mohd/Desktop/Fxt/Reports/src/main/java -textui
[warning] /usr/bin/findbugs: Unable to locate ant in /usr/share/java
Exception in thread "main" java.io.IOException: IOException while scanning codebases
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:285)
at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:402)
at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1200)
Caused by: edu.umd.cs.findbugs.classfile.ResourceNotFoundException: Resource not found: java/lang/Object.class
at edu.umd.cs.findbugs.classfile.impl.ClassPathImpl.lookupResource(ClassPathImpl.java:164)
at edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.build(ClassPathBuilder.java:282)
at edu.umd.cs.findbugs.FindBugs2.buildClassPath(FindBugs2.java:677)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:218)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants