Open Anderson-Xia opened 3 years ago
I have similar issues. I'm running Infer on huge amount of Java open-source projects and in most cases, mvn clean install ...
succeeds but infer capture -- mvn clean install ...
fails. I'm trying to list and classify all cases neatly, and maybe I can share my situation here and discuss about it in this thread soon.
@Anderson-Xia,
I've tried to run infer capture
on some portion of my projects, with Infer built from different tags, tags/v1.1.0
and tags/v1.0.0
. The former failed to capture maven build command, but the latter succeeds. Still there are many other projects not resolved with this method, but it may solve your case. I recommend to try it...
@jiseongg Thank you for your great recommendation! I'll check if other versions work. Have a nice day, jiseongg.
Similar situation here. When running infer on gh actions I will get errors like (use -source 16 or higher to enable records)
, even tho the java version is 17.
openjdk 17.0.4.1 2022-08-12
OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1)
OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode, sharing)
javac 17.0.4.1
Yet it would seem infer is using java 11.
Ok, infer doesn't know how to get the proper java version on it's own. You need to give it the --java-version
param to help him out
I also have the same problem in some projects. I believe the best thing that worked for me (not always) was to have several versions of java (e.g., 8, 11, 20, etc.) on my machine, and everytime I want to run Infer, I will set the --java-version
flag accordingly with my installed java version. I do not know why it is like this, but this was the thing that worked for me for most of the projects that had this problem.
I appreciate it if Infer team fix this issue since it is very confusing.
Hello, author! I am testing my project with infer, and it has been successfully built by maven install. However when I run 'mvn clean' and then 'infer -- mvn install', some compilation errors occur like this. Similar situations also occur in some other projects. They can not be built again with infer.