Comments (25)
Hello @wywlds,
Have you tried running javac Hello.java
and see if it compiles correctly?
I suspect javac
is not installed in your machine.
from infer.
@martinoluca
I installed javac.
Proof:
wyw@wyw-System-Product-Name:~/workspace/test$ javac -version
javac 1.7.0_06
from infer.
Thanks for reporting this. It seems that the execution reached the point where no source files were found:
https://github.com/facebook/infer/blob/master/infer/src/java/jMain.ml#L167
I suspect that we are having issues here with incompatible format:
https://github.com/facebook/infer/blob/master/infer/src/java/jClasspath.ml#L109
which leads to all the classes in the small example to be skipped.
But I would not know how to reproduce it.
from infer.
I'm getting the same error.
I've run the infer/scripts/test.sh script. The output is below:
staff-246-113:infer David$ ./scripts/test.sh
+++ dirname ./scripts/test.sh
++ cd ./scripts
++ pwd
+ SCRIPT_DIR=/Users/David/Documents/Development/tools/infer-osx-v0.1.0/infer/scripts
+ INFER_DIR=/Users/David/Documents/Development/tools/infer-osx-v0.1.0/infer/scripts/..
+ INFER_BIN=/Users/David/Documents/Development/tools/infer-osx-v0.1.0/infer/scripts/../infer/bin
+ '[' '' == --xml ']'
+ TARGETS_TO_COMPILE=()
+ TARGETS_TO_TEST=()
+ '[' -e /Users/David/Documents/Development/tools/infer-osx-v0.1.0/infer/scripts/../infer/bin/InferJava ']'
+ TARGETS_TO_COMPILE+=('java')
+ TARGETS_TO_TEST+=('java')
++ uname
+ platform=Darwin
+ '[' -e /Users/David/Documents/Development/tools/infer-osx-v0.1.0/infer/scripts/../infer/bin/InferClang ']'
+ TARGETS_TO_COMPILE+=('clang')
+ TARGETS_TO_TEST+=('c' 'cpp')
+ '[' Darwin == Darwin ']'
+ TARGETS_TO_TEST+=('objc')
+ '[' -z java ']'
+ '[' -z java ']'
+ cd /Users/David/Documents/Development/tools/infer-osx-v0.1.0/infer/scripts/..
+ make -C infer java clang
make: *** No rule to make target `java'. Stop.
Maybe this will help.
Regards,
from infer.
I've managed to get this working. Upgraded my java installation to:
$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
and downgraded my javac to:
$ javac -version
javac 1.7.0_79
as @jeremydubreil said, looks like compatibility issues.
from infer.
@aussiDavid: Good point! Which version of Java were you using before ?
@wywlds: Can you please check which implementation of Java are you using with java -version
?
from infer.
@jeremydubreil: I'm not 100% sure. From memory it was v1.6~.
from infer.
I upgraded from build 1.7.0_75-b13 to 1.7.0_79 but no joy. I'll be more then happy to help troubleshooting .
Infer looks so promising!
from infer.
@icaspi: what do you get if you do: java -version
?
from infer.
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
from infer.
@icaspi: Thanks! Should normally be working with this version. Which platform are you trying this on ?
from infer.
OSX 10.10.3
from infer.
@icaspi: OK, so nothing we did not test with. Did you try modifying the example file Hello.java
a bit and check if it is always failing
from infer.
@jeremydubreil Sorry I forgot to mention I'm running it using a gradle build on a somewhat of a complex project I'll try to run it on a hello world in a few hours and get back to you, thank you so much!
from infer.
Same problem. I have two java environments for choice. The problem remains on both two versions.
export JAVA_6_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
export JAVA_7_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home
export JAVA_HOME=$JAVA_7_HOME
alias jdk7='export JAVA_HOME=$JAVA_7_HOME'
alias jdk6='export JAVA_HOME=$JAVA_6_HOME'
from infer.
I have the same issue:
OSX 10.10.3,
java version "1.7.0_71"
,Python 2.7.6
loulijun:test loulijun$ infer -- javac Hello.java
TODO: print error message
Starting analysis (Infer version v0.1.0)
Fatal error: exception Sys_error("/Users/loulijun/test/infer-out/captured: No such file or directory")
[ERROR] Failure during create_makefile, original command was
[u'inferJ', u'-g', u'-a', 'infer', u'javac', 'Hello.java']
Traceback (most recent call last):
File "/Users/loulijun/application/infer/infer-osx-v0.1.0/infer/infer/bin/inferJ", line 19, in <module>
stats = analysis.start()
File "/Users/loulijun/application/infer/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 634, in start
self.analyze_and_report()
File "/Users/loulijun/application/infer/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 613, in analyze_and_report
if self.analyze() == os.EX_OK:
File "/Users/loulijun/application/infer/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 489, in analyze
self.args.analyzer
File "/Users/loulijun/application/infer/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/Users/loulijun/application/infer/infer-osx-v0.1.0/infer/infer/bin/InferAnalyze', u'-results_dir', '/Users/loulijun/test/infer-out', u'-makefile', u'Makefile', u'-allow_specs_cleanup', u'-models', u'/Users/loulijun/application/infer/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-project_root', '/Users/loulijun/test']' returned non-zero exit status 2
from infer.
@jeremydubreil Hello.java is working fine I believe this the problem -
At first it complained about LeakCanary (https://github.com/square/leakcanary) I suspect its something with its lint release configuration, after removing LeakCanary it complains about this -
22:41:36.360 [ERROR] [org.gradle.BuildExceptionReporter]
22:41:36.360 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter]
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':libraries:facebook:lint'.
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] > Lint found errors in the project; aborting build.
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter]
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] Fix the issues identified by lint, or add the following to your build script to proceed with errors:
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] ...
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] android {
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] lintOptions {
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] abortOnError false
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] }
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] }
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] ...
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter]
22:41:36.363 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
22:41:36.363 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
My release config (gradle clean assembleGoogleRelease) is building fine...
Any ideas?
from infer.
Waiting for solve this problem.
from infer.
Hi @icaspi, would you mind opening another issue for this problem, since running Infer on Hello.java seems to work for you? Many thanks!
from infer.
@jeremydubreil it's java 1.7.0_06
java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)
from infer.
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
same problems arised~ waiting for the solution..
from infer.
same error.. the solution that i changed javac version from 1.6 to 1.7.
from infer.
same error.. with:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
from infer.
i got a friend use 1.8.0_25 can run this fine.
hope can help solve this problem.
from infer.
We think 82c4dc6 may have solved this issue.
@wywlds @GeekMin @chenleii: please upgrade Infer to the latest git version and try again.
from infer.
Related Issues (20)
- C Simple memory leak cannot be detected HOT 1
- [java] DEADLOCK: False Negative in Infer analysis results after converting anonymous classes to lambda expressions HOT 1
- [java] STARVATION: False Negative in Infer analysis results after converting anonymous classes to lambda expressions HOT 1
- False positive of Infer/Pulse when `std::unique_ptr` is used with no throw `new` HOT 2
- how to use --custom-symbols?
- How to check custom malloc and free functions for memory leak?
- can infer find out all suspecious bugs? HOT 2
- java: Infer injects outdated, buggy maven-compiler-plugin version 3.8.0
- False positive memory leak on loop HOT 4
- Dockerfile: US-ASCII locale causes crash on UTF-8 input
- How to add extra nullability condition to NULL_DEREFERENCE checking
- Is Adding a C++ Infer Port to the VSCode Plugin on the Roadmap? HOT 3
- [java] A false negative about the rule NULL_DEREFERENCE
- [java] A false positive about the rule THREAD_SAFETY_VIOLATION
- `--biabduction-unsafe-malloc` doesn't assume that `calloc()` and `realloc()` never return null HOT 1
- Error building the `Resource Leak analysis` lab in docker
- False positive Uninitialized Value in C code
- Need help when using infer run or capture during maven compilation HOT 1
- Query on --changed-files-index option HOT 3
- Meta leak HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infer.