InAnYan / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
0 stars 0 forks source link

IntelliJ IDEA requires modules for langchain4j #6

Open InAnYan opened 1 month ago

InAnYan commented 1 month ago

JabRef version

5.13 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11

Checked with the latest development build (copy version output from About dialog)

Steps to reproduce the behaviour

Just write the code with langchain4j library.

Appendix

The error IntelliJ gives is:

Package 'dev.langchain4j.data.message' is declared in module 'langchain4j.core', but module 'org.jabref' does not read it

The same applies for other classes.

However, the code compiles without any errors.

Moreover, if we apply the IDEA's advice, the building breaks.

InAnYan commented 1 month ago

@koppor In the repository intellij-issue-modularity I made all the changes, but it stuck at error:

D:\Git\intellij-issue-modularity\src\main\java\org\example\Main.java:5: error: cannot find symbol
import dev.langchain4j.model.embedding.AllMiniLmL6V2EmbeddingModel;
                                      ^
  symbol:   class AllMiniLmL6V2EmbeddingModel
  location: package dev.langchain4j.model.embedding

Could you please update the repo with the changes you made in JabRef?

koppor commented 1 month ago

Can't we add --patch-module (based on the contents of build.gradle) similar to the other "Compilation options" given at https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.html.

koppor commented 4 weeks ago

Could you please update the repo with the changes you made in JabRef?

Done. See https://github.com/InAnYan/intellij-issue-modularity/commit/7ba30faf55c0a4ebf14a83beb1345c624a632fca.

koppor commented 4 weeks ago

BTW, there is a work-around:

Please add following things to intellij-12-build.md (rendered at https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.html)

--add-reads
org.example=langchain4j.embeddings.all.minilm.l6.v2
--add-reads org.example=langchain4j.core

In the text box where other paramters to JabRef.main module are added:

image

InAnYan commented 1 day ago

New parameters:

--add-exports=javafx.controls/com.sun.javafx.scene.control=org.jabref
--add-exports=org.controlsfx.controls/impl.org.controlsfx.skin=org.jabref
--add-reads
org.jabref=org.fxmisc.flowless
--add-reads
org.jabref=org.apache.commons.csv
--add-reads
org.jabref=langchain4j.embeddings.all.minilm.l6.v2
--add-reads
org.jabref=langchain4j.embeddings.all.minilm.l6.v2.q
--add-reads
org.jabref=langchain4j.core
--add-reads
org.jabref=langchain4j.open.ai