InAnYan / jabref

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

Cannot debug JabRef on Windows in IntelliJ IDEA #5

Closed InAnYan closed 2 months ago

InAnYan commented 4 months 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

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 commented 4 months ago

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 commented 4 months ago

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

koppor commented 4 months ago

Links:


Plugin:

koppor commented 3 months ago
InAnYan commented 3 months ago

IntelliJ IDEA 2024.1 Windows 11

IntelliJ IDEA 2024.2 EAP does not work too.

Pinged on YouTrack

koppor commented 3 months ago

Pinged on YouTrack

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

koppor commented 3 months ago

I tried to fix https://github.com/redocksoft/classpath-to-file-gradle-plugin/issues/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 commented 3 months ago

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

InAnYan commented 3 months ago

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

koppor commented 3 months ago

@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.

InAnYan commented 3 months ago

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 commented 3 months ago

Ah, the error reappeared (not gone anymore)? Which means https://github.com/InAnYan/jabref/issues/5#issuecomment-2156403493 is outdated.

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

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

InAnYan commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago
  > 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 commented 3 months ago

Subhramit has this problem

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

image

koppor commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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

image

InAnYan commented 3 months ago

😢 UPDATE: Now running JabRef works.

However, debugging fails with the same error

koppor commented 3 months ago

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 https://github.com/InAnYan/jabref/issues/5#issuecomment-2178233951.

InAnYan commented 3 months ago

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.

:cry: 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 commented 3 months ago

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

ThiloteE commented 3 months ago

To try: https://stackoverflow.com/questions/10519558/createprocess-error-206-the-filename-or-extension-is-too-long-when-running-main

koppor commented 2 months ago

Current state: At the PR https://github.com/JabRef/jabref/pull/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 commented 2 months ago

https://pad.riseup.net/p/jabref-ai-console

InAnYan commented 2 months ago
  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 commented 2 months ago

@InAnYan I still don't have a reply to my comment two weeks ago: https://github.com/InAnYan/jabref/issues/5#issuecomment-2178233951

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 commented 2 months ago

The update at https://github.com/redocksoft/classpath-to-file-gradle-plugin/pull/7 does not help - due to incompatibility with https://github.com/java9-modularity/gradle-modules-plugin

InAnYan commented 2 months ago

@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 commented 2 months ago

изображение

InAnYan commented 2 months ago

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

koppor commented 2 months ago

изображение

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 commented 2 months ago

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 https://github.com/langchain4j/langchain4j/issues/1066. Then, compilation using IntelliJ should work without issues. Then, debugging is also possible.

InAnYan commented 2 months ago

изображение

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 commented 2 months ago

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.