Closed kevinGit777 closed 1 day ago
Hi @kevinGit777,
What's the output of the following three commands in your environment:
java -version
echo $JAVA_HOME
locale
Thanks, René
hi, @rjust
$ java -version openjdk version "1.8.0_292" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode) $ echo $JAVA_HOME /home/.sdkman/candidates/java/current $ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
I also try using 1.7 for java but same output
I can reproduce the issue when explicitly changing the encoding to ASCII (i.e., changing the build file to use the encoding
attribute for the javac task.
Is it possible that your environment, before running defects4j, sets the file encoding to ASCII? Is there maybe a properties file that does so?
With the environment that you provided, the following two commands work on my end (and output the requested classpath):
Best, René
Hi @rjust, I am facing a similar compile error when compiling and testing. Below is my approach and set-up on gcp pod.
**java -version**
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
**echo $JAVA_HOME**
/usr/lib/jvm/java-1.8.0-openjdk-amd64/
I am able to check out the file, but when I try to compile or test, the compile issue about to happen:
**root@cpu:/export/home/defects4j/debug/lang_6_buggy$ defects4j compile**
Running ant (compile)...................................................... FAIL
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=1G; support was removed in 8.0
Buildfile: /export/home/defects4j/framework/projects/defects4j.build.xml
init:
[echo] -------- commons-lang3 3.2-SNAPSHOT --------
compile:
BUILD FAILED
/export/home/defects4j/debug/lang_6_buggy/build.xml:63: Class not found: javac1.8
Total time: 0 seconds
Executed command: cd /export/home/defects4j/debug/lang_6_buggy && ant -f /export/home/defects4j/framework/projects/defects4j.build.xml -Dd4j.home=/export/home/defects4j -Dd4j.dir.projects=/export/home/defects4j/framework/projects -Dbasedir=/export/home/defects4j/debug/lang_6_buggy compile 2>&1
Cannot compile sources! at /export/home/defects4j/framework/bin/d4j/d4j-compile line 82.
Compilation failed in require at /export/home/defects4j/framework/bin/defects4j line 155.
But if I change to ant compile, it works
**ant compile**
Buildfile: /export/home/defects4j/debug/lang_6_buggy/build.xml
init:
[echo] -------- commons-lang3 3.2-SNAPSHOT --------
compile:
BUILD SUCCESSFUL
Total time: 0 seconds
Could you please advise on this issue? Thank you for your help!
Hello! Is there any solution to this problem? I also meet this error on defects4j v2.0 dataset. @kevinGit777 @rjust
Hello,I have also encountered the same problem. How can I solve it? @rjust @wang-weishi
@lemon1-ui,
Are you observing compilation issues for Defects4J version 3?
Can you please provide the exact commands that you issued and the corresponding outputs that show the error?
Additionally, can you please let us know:
(Note that in the above reports, there are two distinct issues related to compiling D4J artifacts.)
Thanks, René
@rjust Hello,when I compile Math96,I encountered some errors,The following is the error message: BUILD FAILED /home/yinyuanyuan/SelfAPR-main/Math96/build.xml:46: Compile failed; see the compiler error output for details. Total time: 0 seconds Cannot compile sources! at /home/yinyuanyuan/software/defects4j/framework/bin/d4j/d4j-compile line 82. Compilation failed in require at /home/yinyuanyuan/software/defects4j/framework/bin/defects4j line 195.")
(lucky6) yinyuanyuan@GPU-Server:~/SelfAPR-main$ locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:en LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC=zh_CN.UTF-8 LC_TIME=zh_CN.UTF-8 LC_COLLATE="zh_CN.UTF-8" LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES="zh_CN.UTF-8" LC_PAPER=zh_CN.UTF-8 LC_NAME=zh_CN.UTF-8 LC_ADDRESS=zh_CN.UTF-8 LC_TELEPHONE=zh_CN.UTF-8 LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=zh_CN.UTF-8 LC_ALL= and (lucky6) yinyuanyuan@GPU-Server:~/SelfAPR-main$ java -version java version "1.8.0_411" Java(TM) SE Runtime Environment (build 1.8.0_411-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.411-b09, mixed mode) and (lucky6) yinyuanyuan@GPU-Server:~/SelfAPR-main$ git --version git version 2.25.1
What version of Defects4J are you using?
Also, based on the provided trace, it looks like the defects4j compile
command is executed as a subprocess in a different tool -- presumably some APR tool?
What's the output of the following two commands?
defects4j checkout -p Math -v 96b -w /tmp/Math96
defects4j compile -w /tmp/Math96
@rjust May be I use the defects4j-2.0. I installed it by using git clone https://github.com/rjust/defects4j. Yes, I use it in an APR tool. The output as follow.
@rjust Well, how to view the version of Defects4J?
Since the defects4j commands succeed, it looks like the compilation error is either caused by the APR tool's environment or perhaps the tool incorrectly patched a source file such that a compilation error is expected?
Re defects4j version: You can check the commit hash of the HEAD revision in your cloned defects4j repository. Based on the outputs, I am pretty confident that this is version 2 (the actual commit may differ slightly from the tagged version 2). That said, these compilation errors seem unrelated to Defects4J, so version 2 vs. version 3 probably does not matter.
Thanks so much. I will check them in others.
hi, I got this message and hope you guys can help me. Thank you so much!
` similar things happened in compiling Closure-149
system info: git version 2.17.1 svn, version 1.9.7 (r1800392) defect4j up to date