First time setup error : Execution failed for task ':generateBstGrammarSource'

I am new to JabRef.
I have done all the setup carefully after reading the documentation but I get this error when I try to build using gradle.

Error: Execution failed for task ‘:generateBstGrammarSource’.

Can you try adding --info to the Gradle task and post the output? Press Edit Configuration... in the circled upper right corner, and add the --info flag as highlighted.

And don’t worry about things having different names, my setup is a bit messy.

Thank you for helping me!
It shows this:

Full log:

1:18:32 PM: Executing ‘run --info’…

The client will now receive all logging from the daemon (pid: 17852). The daemon log file: C:\Users\verma.gradle\daemon\7.6\daemon-17852.out.log
Starting 3rd build in daemon [uptime: 3 mins 1.22 secs, performance: 100%]
Using 12 worker leases.
Now considering [E:\jabref, E:\jabref\buildSrc] as hierarchies to watch
Now considering [E:\jabref\buildSrc, E:\jabref] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file ‘E:\jabref\settings.gradle’.
Projects loaded. Root project using build file ‘E:\jabref\build.gradle’.
Included projects: [root project ‘JabRef’]

Configure project :buildSrc
Evaluating project ‘:buildSrc’ using build file ‘E:\jabref\buildSrc\build.gradle’.
Task name matched ‘build’
Selected primary task ‘build’ from project :
Resolve mutations for :buildSrc:compileJava (Thread[Execution worker,5,main]) started.
:buildSrc:compileJava (Thread[Execution worker,5,main]) started.

Task :buildSrc:compileJava UP-TO-DATE
Caching disabled for task ‘:buildSrc:compileJava’ because:
Build cache is disabled
Skipping task ‘:buildSrc:compileJava’ as it is up-to-date.
Resolve mutations for :buildSrc:compileGroovy (Thread[Execution worker,5,main]) started.
:buildSrc:compileGroovy (Thread[Execution worker,5,main]) started.

Task :buildSrc:compileGroovy UP-TO-DATE
Caching disabled for task ‘:buildSrc:compileGroovy’ because:
Build cache is disabled
Skipping task ‘:buildSrc:compileGroovy’ as it is up-to-date.
Resolve mutations for :buildSrc:processResources (Thread[Execution worker,5,main]) started.
:buildSrc:processResources (Thread[Execution worker,5,main]) started.

Task :buildSrc:processResources NO-SOURCE
Skipping task ‘:buildSrc:processResources’ as it has no source files and no previous output files.
Resolve mutations for :buildSrc:classes (Thread[Execution worker,5,main]) started.
:buildSrc:classes (Thread[Execution worker,5,main]) started.

Task :buildSrc:classes UP-TO-DATE
Skipping task ‘:buildSrc:classes’ as it has no actions.
Resolve mutations for :buildSrc:jar (Thread[Execution worker,5,main]) started.
:buildSrc:jar (Thread[Execution worker,5,main]) started.

Task :buildSrc:jar UP-TO-DATE
Caching disabled for task ‘:buildSrc:jar’ because:
Build cache is disabled
Skipping task ‘:buildSrc:jar’ as it is up-to-date.
Resolve mutations for :buildSrc:assemble (Thread[Execution worker,5,main]) started.
:buildSrc:assemble (Thread[Execution worker,5,main]) started.

Task :buildSrc:assemble UP-TO-DATE
Skipping task ‘:buildSrc:assemble’ as it has no actions.
Resolve mutations for :buildSrc:compileTestJava (Thread[Execution worker,5,main]) started.
:buildSrc:compileTestJava (Thread[Execution worker,5,main]) started.

Task :buildSrc:compileTestJava NO-SOURCE
Skipping task ‘:buildSrc:compileTestJava’ as it has no source files and no previous output files.
Resolve mutations for :buildSrc:compileTestGroovy (Thread[Execution worker,5,main]) started.
:buildSrc:compileTestGroovy (Thread[Execution worker,5,main]) started.

Task :buildSrc:compileTestGroovy NO-SOURCE
Skipping task ‘:buildSrc:compileTestGroovy’ as it has no source files and no previous output files.
Resolve mutations for :buildSrc:processTestResources (Thread[Execution worker,5,main]) started.
:buildSrc:processTestResources (Thread[Execution worker,5,main]) started.

Task :buildSrc:processTestResources NO-SOURCE
Skipping task ‘:buildSrc:processTestResources’ as it has no source files and no previous output files.
Resolve mutations for :buildSrc:testClasses (Thread[Execution worker,5,main]) started.
:buildSrc:testClasses (Thread[Execution worker,5,main]) started.

Task :buildSrc:testClasses UP-TO-DATE
Skipping task ‘:buildSrc:testClasses’ as it has no actions.
Resolve mutations for :buildSrc:test (Thread[Execution worker,5,main]) started.
producer locations for task group 0 (Thread[Execution worker,5,main]) started.
:buildSrc:test (Thread[Execution worker Thread 4,5,main]) started.

Task :buildSrc:test NO-SOURCE
Skipping task ‘:buildSrc:test’ as it has no source files and no previous output files.
Resolve mutations for :buildSrc:check (Thread[Execution worker Thread 4,5,main]) started.
:buildSrc:check (Thread[Execution worker Thread 4,5,main]) started.

Task :buildSrc:check UP-TO-DATE
Skipping task ‘:buildSrc:check’ as it has no actions.
Resolve mutations for :buildSrc:build (Thread[Execution worker Thread 4,5,main]) started.
:buildSrc:build (Thread[Execution worker Thread 4,5,main]) started.

Task :buildSrc:build UP-TO-DATE
Skipping task ‘:buildSrc:build’ as it has no actions.

Configure project :
Evaluating root project ‘JabRef’ using build file ‘E:\jabref\build.gradle’.
Project : => ‘org.jabref’ Java module


Detecting the operating system and CPU architecture

os.detected.name=windows
os.detected.arch=x86_64
os.detected.bitness=64
os.detected.version=10.0
os.detected.version.major=10
os.detected.version.minor=0
os.detected.classifier=windows-x86_64
compileTestJava.compileOnClasspath: false
C:\Users\verma.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-xjc\4.0.0\fefc123d8b9828f27c85c84533414e2da83914c1\jaxb-xjc-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.0\1f672b28726bc355cbbde7aed7001fe024fc6f13\jaxb-runtime-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.0\83ab64d327198b2facd4071415d782ebc69469a1\jaxb-core-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\xsom\4.0.0\680e05f400be95f9776ee5158e1c1b58788710a1\xsom-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\codemodel\4.0.0\4582446a720791618ffcc960d041cda2ee185117\codemodel-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\com.sun.xml.bind.external\rngom\4.0.0\8a04fafcbae3ca43a46a09a681c6ef5df654e855\rngom-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\com.sun.xml.dtd-parser\dtd-parser\1.5.0\7e15971a0509f6b7091f49da3a2a727cfa756442\dtd-parser-1.5.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-tools\4.1.1\c54b869d6f419c6a2f4a464bd7931156bf4ab1b9\istack-commons-tools-4.1.1.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.0\bbb399208d288b15ec101fa4fcfc4bd77cedc97a\jakarta.xml.bind-api-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\1.0.0\f0ceddd49f92109fbfad9125e958f5bfd3f2aa1\angus-activation-1.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.0\a58861b5deac5e151140511cf57d6b80a83f2d20\jakarta.activation-api-2.1.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.0\afa5e81b5a9a390c98651a3da71c7f4cde14bcf0\txw2-4.0.0.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.1\9b3769c76235bc283b060da4fae2318c6d53f07e\istack-commons-runtime-4.1.1.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\com.sun.xml.bind.external\relaxng-datatype\4.0.0\527ae6525341b7fd2ca9f7d6a54a9bd6871b9b33\relaxng-datatype-4.0.0.jar
All projects evaluated.
Task name matched ‘run’
Selected primary task ‘run’ from project :
Tasks to be executed: [task ‘:configJavafxRun’, task ‘:generateBibtexmlSource’, task ‘:generateBstGrammarSource’, task ‘:generateCitaviSource’, task ‘:generateEndnoteSource’, task ‘:generateMedlineSource’, task ‘:generateModsSource’, task ‘:generateSearchGrammarSource’, task ‘:generateSource’, task ‘:compileJava’, task ‘:processResources’, task ‘:classes’, task ‘:jar’, task ‘:mergeClasses’, task ‘:run’]
Tasks that were excluded:
Resolve mutations for :configJavafxRun (Thread[Execution worker Thread 11,5,main]) started.
:configJavafxRun (Thread[included builds,5,main]) started.

Task :configJavafxRun
Caching disabled for task ‘:configJavafxRun’ because:
Build cache is disabled
Task ‘:configJavafxRun’ is not up-to-date because:
Task has not declared any outputs despite executing actions.
Modular JavaFX application found
Resolve mutations for :generateBibtexmlSource (Thread[included builds,5,main]) started.
:generateBibtexmlSource (Thread[included builds,5,main]) started.

Task :generateBibtexmlSource UP-TO-DATE
Caching disabled for task ‘:generateBibtexmlSource’ because:
Build cache is disabled
Skipping task ‘:generateBibtexmlSource’ as it is up-to-date.
Resolve mutations for :generateBstGrammarSource (Thread[included builds,5,main]) started.
:generateBstGrammarSource (Thread[included builds,5,main]) started.

Task :generateBstGrammarSource FAILED
Caching disabled for task ‘:generateBstGrammarSource’ because:
Build cache is disabled
Task ‘:generateBstGrammarSource’ is not up-to-date because:
Task has failed previously.
Starting process ‘command ‘C:\Users\verma.jdks\temurin-18.0.2.1\bin\java.exe’’. Working directory: E:\jabref Command: C:\Users\verma.jdks\temurin-18.0.2.1\bin\java.exe -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\verma.gradle\caches\modules-2\files-2.1\org.antlr\antlr4\4.11.1\844c603e04ab201b769849ee9d3cce67ba7a1337\antlr4-4.11.1.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.11.1\69214c1de1960040729702eb58deac8827135e7\antlr4-runtime-4.11.1.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.antlr\ST4\4.3.4\bf68d049dd4e6e104055a79ac3bf9e6307d29258\ST4-4.3.4.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.antlr\antlr-runtime\3.5.3\9011fb189c5ed6d99e5f3322514848d1ec1e1416\antlr-runtime-3.5.3.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.abego.treelayout\org.abego.treelayout.core\1.0.3\457216e8e6578099ae63667bb1e4439235892028\org.abego.treelayout.core-1.0.3.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\org.glassfish\javax.json\1.1.4\943f240a509d3c70b448a55c6735591ecbd37c88\javax.json-1.1.4.jar;C:\Users\verma.gradle\caches\modules-2\files-2.1\com.ibm.icu\icu4j\71.1\9e7d3304c23f9ba5cb71915f7cce23231a57a445\icu4j-71.1.jar org.antlr.v4.Tool -o src-gen/main/java/org/jabref/logic/bst/ -visitor -no-listener -package org.jabref.logic.bst E:\jabref/src/main/antlr4/org/jabref/bst/Bst.g4
Successfully started process ‘command ‘C:\Users\verma.jdks\temurin-18.0.2.1\bin\java.exe’’
context [/report CANNOT_WRITE_FILE] 1:19 attribute arg isn’t defined
error(1): cannot write file :
error(1): cannot write file BstParser.java:
error(1): cannot write file Bst.tokens:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:generateBstGrammarSource’.

Process ‘command ‘C:\Users\verma.jdks\temurin-18.0.2.1\bin\java.exe’’ finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 994ms

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See Command-Line Interface
6 actionable tasks: 2 executed, 4 up-to-date
Watched directory hierarchies: [E:\jabref]
1:18:33 PM: Execution finished ‘run --info’.

  1. Open a Terminal in IntelliJ (twice-shift and then select “Terminal” - or press Alt+F12)
  2. Enter “E:” and press Enter
  3. Enter “cd \jabref” and press Enter
  4. Enter “mkdir src-gen/main/java/org/jabref/logic/bst/” and press Enter

What is the output?

  1. Enter “dir src-gen/main/java/org/jabref/logic/bst/” and press Enter

What is the output?

An issue with a similar error message was reported to the antlr4 repository. Apparently, it happens when running Docker inside a Mingw-w64 shell. Docker instructions for Windows are insufficient · Issue #3209 · antlr/antlr4 (github.com)

Another similar issue: ANTLR fails to generate files in folder under root directory · Issue #2928 · antlr/antlr4 (github.com)

It might also be that you don’t have permission to write in that location, so try running IntelliJ as administrator.

Try to move the jabref folder from root E:\ to another nested folder. Then run gradle clean and gradle build.

Note that our instructions at Set up a local workspace - Developer Documentation also recommend to create a sub directory git-repositories. Thus, the guide was not fully followed.

I’ve reworded the documentation to make it clear that placing directly under drive letter will create compile errors