Error occurred during initialization of boot layer java.lang.module.FindException: Module vosk not found
So I was trying to do some stuffs with offline voice recognizer vosk api in intellij idea. I added vosk dependency using gradle. For all other libraries and dependency it worked like charm. But after adding the vosk api, it wont build. it told me to add vosk in module-info.java and i did. here is my directory structure: (I removed some directories that looked like not required for this query like build and blah blah)
❯ tree
.
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── model
├── settings.gradle
├── src
│ └── main
│ ├── java
│ │ ├── com
│ │ │ └── troika
│ │ │ └── teddit
│ │ │ ├── recognizer.java
│ │ │ └── TedditApplication.java
│ │ └── module-info.java
│ └── resources
└── Teddit.iml
my build.gradle has the vosk and jna dependency:
//file:noinspection GroovyUnusedAssignment
//file:noinspection GroovyUnusedAssignment
//file:noinspection GrUnresolvedAccess
//noinspection GrUnresolvedAccess
plugins{
id 'application'
}
group 'com.Troika'
version '1.0-SNAPSHOT'
repositories{
mavenCentral()
}
ext{
junitVersion = '5.8.2'
}
sourceCompatibility = '17'
targetCompatibility = '17'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
application{
mainModule = 'com.troika.teddit'
mainClass = 'com.troika.teddit.HelloApplication'
}
dependencies{
implementation group: 'net.java.dev.jna', name: 'jna', version: '5.10.0'
implementation group: 'com.alphacephei', name: 'vosk', version: '0.3.33'
}
the module-info.java looks like:
module com.troika.teddit {
requires vosk;
exports com.troika.teddit;
}
I have looked up a lot but due to having less results and me being a noob, i was not able to understand what actually went wrong and i still can't fix this issue. So please help me out of this situation. I am currently using intellij idea version 2021.3.3 ultimate version on arch linux (64-bit architecture).
Please sign in to leave a comment.
Does the issue occur only in IntelliJ IDEA? Does the project build and run without errors from the command line Gradle?