GithubHelp home page GithubHelp logo

Comments (25)

martinoluca avatar martinoluca commented on April 27, 2024

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.

wywlds avatar wywlds commented on April 27, 2024

@martinoluca
I installed javac.
Proof:
wyw@wyw-System-Product-Name:~/workspace/test$ javac -version
javac 1.7.0_06

from infer.

jeremydubreil avatar jeremydubreil commented on April 27, 2024

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.

aussiDavid avatar aussiDavid commented on April 27, 2024

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.

aussiDavid avatar aussiDavid commented on April 27, 2024

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.

jeremydubreil avatar jeremydubreil commented on April 27, 2024

@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.

aussiDavid avatar aussiDavid commented on April 27, 2024

@jeremydubreil: I'm not 100% sure. From memory it was v1.6~.

from infer.

icaspi avatar icaspi commented on April 27, 2024

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.

jeremydubreil avatar jeremydubreil commented on April 27, 2024

@icaspi: what do you get if you do: java -version ?

from infer.

icaspi avatar icaspi commented on April 27, 2024

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.

jeremydubreil avatar jeremydubreil commented on April 27, 2024

@icaspi: Thanks! Should normally be working with this version. Which platform are you trying this on ?

from infer.

icaspi avatar icaspi commented on April 27, 2024

OSX 10.10.3

from infer.

jeremydubreil avatar jeremydubreil commented on April 27, 2024

@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.

icaspi avatar icaspi commented on April 27, 2024

@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.

wzpan avatar wzpan commented on April 27, 2024

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.

loulijun avatar loulijun commented on April 27, 2024

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.

icaspi avatar icaspi commented on April 27, 2024

@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.

DoctorQ avatar DoctorQ commented on April 27, 2024

Waiting for solve this problem.

from infer.

jvillard avatar jvillard commented on April 27, 2024

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.

wywlds avatar wywlds commented on April 27, 2024

@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.

GeekMin avatar GeekMin commented on April 27, 2024

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.

ezcocoa avatar ezcocoa commented on April 27, 2024

same error.. the solution that i changed javac version from 1.6 to 1.7.

from infer.

 avatar commented on April 27, 2024

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.

tianyutingxy avatar tianyutingxy commented on April 27, 2024

i got a friend use 1.8.0_25 can run this fine.
hope can help solve this problem.

from infer.

jvillard avatar jvillard commented on April 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.