Skip to content
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

Cannot debug JabRef on Windows in IntelliJ IDEA #5

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

Cannot debug JabRef on Windows in IntelliJ IDEA #5

InAnYan opened this issue May 18, 2024 · 37 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

Debug JabRef in IntelliJ IDEA

Appendix

The exact error the IDE gave me is:

CreateProcess error=206, The filename or extension is too long
@koppor
Copy link
Collaborator

koppor commented May 19, 2024

Which version of the IDE?

I think, I had the error with 2024.1.1, but I did not see it with 2024.2 EAP.

@koppor
Copy link
Collaborator

koppor commented May 19, 2024

The solutions at https://stackoverflow.com/questions/69376895/createprocess-error-206-the-filename-or-extension-is-too-long did not solve the issues with 2024.1.1

@InAnYan InAnYan added bug Something isn't working Depends-on-External Issue can't be solved entirely by ourselves labels May 27, 2024
@koppor
Copy link
Collaborator

koppor commented May 28, 2024

@InAnYan
Copy link
Owner Author

InAnYan commented May 29, 2024

IntelliJ IDEA 2024.1
Windows 11

IntelliJ IDEA 2024.2 EAP does not work too.

Pinged on YouTrack

@koppor
Copy link
Collaborator

koppor commented May 30, 2024

Pinged on YouTrack

Thank you. Please share IDE logs (I wrote that above in the last sentence; therefore I kept that item open)

@koppor
Copy link
Collaborator

koppor commented Jun 7, 2024

I tried to fix redocksoft/classpath-to-file-gradle-plugin#2.

Please try to

... "publish" the updated plugin:

  1. git clone https://github.com/koppor/classpath-to-file-gradle-plugin.git
  2. cd classpath-to-file-gradle-plugin
  3. git checkout update
  4. gradlew publishToMavenLocal

... make the plugin available to gradle:

  1. Open IntelliJ JabRef project

  2. Patch settings.gradle - add that in the beginning

    + pluginManagement {
    +     repositories {
    +         mavenLocal()
    +         gradlePluginPortal()
    +     }
    + }
  3. Patch build.gradle; add to plugins

    id 'com.redock.classpathtofile' version '0.1.0'

@koppor
Copy link
Collaborator

koppor commented Jun 7, 2024

@InAnYan Double check: Where is JabRef checked out? Is it c:\git-repositories\JabRef or do you use another folder?

@InAnYan
Copy link
Owner Author

InAnYan commented Jun 9, 2024

@koppor I'm so sorry. The error is gone 😆

@koppor
Copy link
Collaborator

koppor commented Jun 9, 2024

@koppor I'm so sorry. The error is gone 😆

Like here 😅

Anything you remember? Updating? Checking out again? Updating dependencies? Maybe it could be that using the EAP version and merging in main could have lead to regenerating the configuration in a "good" way.

@koppor koppor closed this as completed Jun 9, 2024
@InAnYan
Copy link
Owner Author

InAnYan commented Jun 10, 2024

I remember I update to 2024.1.2, but the problem was still there. EAP had the problem too.

Discovered this accidentally, while thinking about reopening the issue on YouTrack and testing your plugin

@koppor koppor reopened this Jun 10, 2024
@koppor
Copy link
Collaborator

koppor commented Jun 10, 2024

Ah, the error reappeared (not gone anymore)? Which means #5 (comment) is outdated.

Then try https://stackoverflow.com/a/74816455/873282

Please try the solutions as otherwise you cannot develop properly, can you?

@InAnYan
Copy link
Owner Author

InAnYan commented Jun 11, 2024

No, no, I mean, I asked, what actions I did. Like, I did nothing, the problem was everywhere, but one day it gone.

Subhramit has this problem

@InAnYan InAnYan closed this as completed Jun 11, 2024
@InAnYan InAnYan reopened this Jun 17, 2024
@InAnYan
Copy link
Owner Author

InAnYan commented Jun 17, 2024

No the issue is there 😢.

I have this error while running gradlew publishToMavenLocal:

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Could not isolate parameters org.jetbrains.kotlin.gradle.internal.transforms.BuildToolsApiClasspathEntrySnapshotTransform$Parameters_Decorated@3fd5e9b1 of artifact transform BuildToolsApiClasspathEntrySnapshotTransform
   > Could not isolate value org.jetbrains.kotlin.gradle.internal.transforms.BuildToolsApiClasspathEntrySnapshotTransform$Parameters_Decorated@3fd5e9b1 of type BuildToolsApiClasspathEntrySnapshotTransform.Parameters
      > Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is running on a JDK, not JRE.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 19s
3 actionable tasks: 3 executed

@koppor
Copy link
Collaborator

koppor commented Jun 17, 2024

  > Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is running on a JDK, not JRE.

Seems like an exercise how to use Google? 😅

Blind guess without Google: Does your JAVA_HOME variable point to a valid JDK path?

@koppor
Copy link
Collaborator

koppor commented Jun 17, 2024

Subhramit has this problem

Update in today's DevCall: The solution of https://stackoverflow.com/a/74816455/873282 really works

image

@koppor
Copy link
Collaborator

koppor commented Jun 17, 2024

Blind guess without Google: Does your JAVA_HOME variable point to a valid JDK path?

Not needed any more. One can use the newest release of the plugin - see https://github.com/redocksoft/classpath-to-file-gradle-plugin?tab=readme-ov-file#installation for details. -- We should try this.

@koppor
Copy link
Collaborator

koppor commented Jun 19, 2024

Without the plugin, it is even worse:

koppor@DESKTOP-KAK953S MINGW64 /c/git-repositories/jabref (ai-1)
$ ./gradlew run
Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :
Project : => 'org.jabref' Java module

> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :run FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':run'.
> Process 'command 'C:\Program Files\OpenJDK\jdk-21.0.2\bin\java.exe'' could not be started because the command line exceed operating system limits.

@koppor
Copy link
Collaborator

koppor commented Jun 19, 2024

The workaround to compile and run with IntelliJ (and not gradle) should be tried. See https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-89-run-with-intellij.html for details.

@koppor
Copy link
Collaborator

koppor commented Jun 19, 2024

Update from my side - I can reproduce the reported "exit value 1" error:

image

@InAnYan
Copy link
Owner Author

InAnYan commented Jun 19, 2024

😢
UPDATE: Now running JabRef works.

However, debugging fails with the same error

@koppor
Copy link
Collaborator

koppor commented Jun 19, 2024

However, debugging fails with the same error

I assume you are trying to debug with gradle. Please try to debug with the IntelliJ compiler. Link is in the comment #5 (comment).

@InAnYan
Copy link
Owner Author

InAnYan commented Jun 19, 2024

The workaround to compile and run with IntelliJ (and not gradle) should be tried. See devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-89-run-with-intellij.html for details.

😢 again langchain4j

Error on step 5:

изображение

Executing pre-compile tasks…
Cleaning output directories…
Running 'before' tasks
Checking sources
Copying resources... [JabRef.test]
Copying resources... [JabRef.main]
Parsing java… [JabRef.main]
java: java.lang.reflect.InvocationTargetException
Modules langchain4j.core and langchain4j export package dev.langchain4j.retriever to module org.antlr.antlr4.runtime
java: java.lang.reflect.InvocationTargetException
Errors occurred while compiling module 'JabRef.main'
javac 21.0.2 was used to compile java sources
Finished, saving caches…
Executing post-compile tasks…
Synchronizing output directories…
19.06.2024 13:36 - Build completed with 2 errors and 0 warnings in 9 sec, 168 ms

@InAnYan
Copy link
Owner Author

InAnYan commented Jun 19, 2024

Oliver, let's forget this, I don't want to distract you with updates.

The error appeared again, I can't even run JabRef.

I'll just try to make run Skype on Linux better

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

koppor commented Jun 27, 2024

Current state: At the PR JabRef#11430, ./gradlew run does not work. Thus, we need to fix the gradle run thing.

(And IntelliJ can come later. We should have Gradle working. One can also run using gradle in intellij, which is the default setup. Only in advanced setup, one uses IntelliJ to run the thing. See https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-89-run-with-intellij.html)

@InAnYan
Copy link
Owner Author

InAnYan commented Jul 1, 2024

@InAnYan
Copy link
Owner Author

InAnYan commented Jul 1, 2024

  1. Some gradle plugins returned non zero exit value. When I was experimenting with logs (run gradle with --info), it turns out that they can't find "org.jabref" module. Is there any solution for that?
  2. I've also found the command line that is executed. I've pasted it in rise up pad. Oliver, maybe it can give you some hints on how to reduce it?
  3. I've tried several main solutions, but in the end they didn't work. I still have some to try.
    What's interesting, when I turned off command line limits in some windows system settings, the error is still there but it has different message. I also remember that there is a parameter about "dynamic.classpath" in "workspace.xml". But..... I can't edit the file, IntelliJ would just delete my setting. I tried to edit the file externally, but it deletes the line with "dynamic.classpath" too. Oliver, I remember you told that it works, how did you do that?

@koppor
Copy link
Collaborator

koppor commented Jul 3, 2024

@InAnYan I still don't have a reply to my comment two weeks ago: #5 (comment)

Maybe I have to rephase: One can run with gradle. One can also run with IntelliJ.

Two questions:

  1. How is your system configured?\
    image
  2. What happens if you change to IntelliJ? See https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-89-run-with-intellij.html for instructions

@koppor
Copy link
Collaborator

koppor commented Jul 3, 2024

@InAnYan
Copy link
Owner Author

InAnYan commented Jul 4, 2024

@InAnYan I still don't have a reply to my comment two weeks ago: #5 (comment)

Maybe I have to rephase: One can run with gradle. One can also run with IntelliJ.

Two questions:

1. How is your system configured?\
   ![image](https://private-user-images.githubusercontent.com/1366654/345588428-2ca3a9ca-f8e2-4694-9577-d713de94f08e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNzgzNTIsIm5iZiI6MTcyMDA3ODA1MiwicGF0aCI6Ii8xMzY2NjU0LzM0NTU4ODQyOC0yY2EzYTljYS1mOGUyLTQ2OTQtOTU3Ny1kNzEzZGU5NGYwOGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDRUMDcyNzMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWMyMzBkNDIzMjA0NmFhNTBjZDEzMzdjOWJjNDlhN2FiYjc3ZTk3MzQwNDlmZDNjYjViYjFiNmIwMmNjMjA1NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.fObewm0273jtMZAqahhhrq8BdjdnXaJ0A0QNko-kyDI)

2. What happens if you change to IntelliJ?  See [devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-89-run-with-intellij.html](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-89-run-with-intellij.html) for instructions

Ah, I remember, it was the time where the issue just gone. Need to try this method

@InAnYan
Copy link
Owner Author

InAnYan commented Jul 4, 2024

изображение

@InAnYan
Copy link
Owner Author

InAnYan commented Jul 4, 2024

yeah, and I don't have out dir in build/resources/main

@koppor
Copy link
Collaborator

koppor commented Jul 4, 2024

изображение

There is context missing for this. I assume, you are at another branch (NOT ai-pr-1). You seem to have added new dependencies. Does your code compile in IntelliJ? Is intellij-12-build.md updated?

@koppor
Copy link
Collaborator

koppor commented Jul 4, 2024

I could not get --patch-module working inside IntelliJ (refs https://youtrack.jetbrains.com/issue/IDEA-273668/javac-patch-module-compiler-flag-does-not-work). Thus, I am waiting for the fix langchain4j/langchain4j#1066. Then, compilation using IntelliJ should work without issues. Then, debugging is also possible.

@InAnYan
Copy link
Owner Author

InAnYan commented Jul 4, 2024

изображение

There is context missing for this. I assume, you are at another branch (NOT ai-pr-1). You seem to have added new dependencies. Does your code compile in IntelliJ? Is intellij-12-build.md updated?

No, no, it's the ai-pr-1

Sorry, should've mentioned: I've followed the https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-89-run-with-intellij.html and couldn't build the project

@koppor
Copy link
Collaborator

koppor commented Jul 4, 2024

The issue title is very generic. With gradle, it should work now. Please check (on the ai-pr-1 branch). Double check that gradle is used as build tool.

@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

3 participants