Skip to content

IntelliJ IDEA requires modules for langchain4j #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
InAnYan opened this issue May 18, 2024 · 8 comments
Closed
2 tasks done

IntelliJ IDEA requires modules for langchain4j #6

InAnYan opened this issue May 18, 2024 · 8 comments

Comments

@InAnYan
Copy link
Owner

InAnYan commented May 18, 2024

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)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

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 InAnYan added bug Something isn't working Depends-on-External Issue can't be solved entirely by ourselves labels May 27, 2024
@InAnYan
Copy link
Owner Author

InAnYan commented May 30, 2024

@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
Copy link
Collaborator

koppor commented Jun 2, 2024

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
Copy link
Collaborator

koppor commented Jun 4, 2024

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

Done. See InAnYan/intellij-issue-modularity@7ba30fa.

@koppor
Copy link
Collaborator

koppor commented Jun 4, 2024

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

@koppor koppor added build-system and removed bug Something isn't working Depends-on-External Issue can't be solved entirely by ourselves labels Jun 27, 2024
@InAnYan
Copy link
Owner Author

InAnYan commented Jul 1, 2024

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

@koppor
Copy link
Collaborator

koppor commented Jul 4, 2024

With the fix, there are no compiler errors, the imports are without errors, too:

image

Thus, closing this issue.

@koppor koppor closed this as completed Jul 4, 2024
@koppor
Copy link
Collaborator

koppor commented Jul 4, 2024

Reopening; cannot get --patch-module to work. I always get

image


Blocked by langchain4j/langchain4j#1066

@koppor koppor reopened this Jul 4, 2024
@koppor
Copy link
Collaborator

koppor commented Jul 4, 2024

@InAnYan This can be closed, because with the configuration of the compiler, the issue indicated by the title is working

@InAnYan I would propose to open another issue for compilation with IntelliJ referencing to langchain4j/langchain4j#1066. This is different enough to this one.

@InAnYan InAnYan closed this as completed Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants