Fatal error: exception Failure("Failed to load any Java source code")
when I run "infer -- javac Hello.java", I get this error. Fatal error: exception Failure("Failed to load any Java source code") Traceback (most recent call last): File "/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/infer", line 168, in main() File "/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/infer", line 143, in main capture_exitcode = imported_module.gen_instance(args, cmd).capture() File "/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/../lib/capture/javac.py", line 33, in capture if self.args.debug: AttributeError: JavacCapture instance has no attribute 'args'
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) javac -version javac 1.7.0_79
the contents of infer-out/toplevel.log [INFO] Running command /Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/infer -- javac Hello.java [INFO] Path to infer script /Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/infer (/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/infer) [INFO] Infer version v0.2.0 Copyright 2009 - present Facebook. All Rights Reserved.
[INFO] Platform: Darwin-14.3.0-x86_64-i386-64bit [INFO] PATH=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin:/Users/mengdongsheng/.opam/4.01.0/bin:/Users/mengdongsheng/.opam/4.01.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin:/Users/mengdongsheng/Documents/AndroidDev/android-sdk-macosx/platform-tools: [INFO] SHELL=/bin/bash [INFO] PWD=/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer [ERROR] Javac compilation error with:
['javac', '-g', 'Hello.java']
[INFO] Capture phase was successful
We think we have a fix for this (not in any release yet): https://github.com/facebook/infer/pull/94
Could you try running following command to see if it works? infer -- javac -J-Duser.language=en Hello.java
use this comment is ok "infer -- javac -J-Duser.language=en Hello.java" , but how can i use it in check a gradlew project
@tianyutingxy you can either wait until we create new release or patch your infer with this change: https://github.com/occho/infer/commit/7219f81bf7a0902e23ee9d852929a0cecf08993c It's a change to scripts so you don't need to recompile anything.
@akotulski Thanks! I try this command "infer -- javac -J-Duser.language=en Hello.java", it's ok.