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

Intelij run configuration not working #9303

Closed
2 tasks done
thiagocferr opened this issue Oct 24, 2022 · 9 comments · Fixed by #9355
Closed
2 tasks done

Intelij run configuration not working #9303

thiagocferr opened this issue Oct 24, 2022 · 9 comments · Fixed by #9355

Comments

@thiagocferr
Copy link
Contributor

JabRef version

Other (please describe below)

Operating system

GNU / Linux

Details on version and operating system

Manjaro with GNOME 42.4, Jabref main branch (commit 349c879)

Checked with the latest development build

  • 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

  1. Setup local workspace, including Intelij IDE configuration;
  2. Try running application with JabRef Main run config;
  3. Errors stop the application from running.

This behavior seems to manifest in two ways:

  1. Intelij cannot run because the application's main entry point has changed from org.jabref.gui.JabRefMain to org.jabref.cli.Launcher in PR Process CLI arguments before starting gui #9217. I've been able to run normally by just changing the entry point on the config file (and was not sure if this was going to be reverted, as PR Revert "Process CLI arguments before starting gui" #9257 was still open at the time)
  2. Now, I cannot run even with the entry point change because of a build error on org.jabref.gui.desktop.os.Windows. See appendix for error message.

Appendix

...

Log File
/home/james/Documents/Github Repos/Public/jabref/src/main/java/org/jabref/gui/desktop/os/Windows.java:84:9
java: cannot access com.sun.jna.LastErrorException
  class file for com.sun.jna.LastErrorException not found
@koppor
Copy link
Member

koppor commented Oct 24, 2022

What is your output of java -version?

Mine is:

$ java -version
openjdk version "19" 2022-09-20
OpenJDK Runtime Environment Temurin-19+36 (build 19+36)
OpenJDK 64-Bit Server VM Temurin-19+36 (build 19+36, mixed mode, sharing)

@koppor
Copy link
Member

koppor commented Oct 24, 2022

We are currently using the gradle task "run" - this doesn't work at your side because of the compiliation error?

grafik

@koppor
Copy link
Member

koppor commented Oct 24, 2022

Could you update to the latest main branch? My line 84 does not contain a JNA call.

grafik

@koppor
Copy link
Member

koppor commented Oct 24, 2022

What is the output of ./gradlew --version? Mine is as follows:

$ gradlew --version                                                                  
                                                                                     
------------------------------------------------------------                         
Gradle 7.5.1                                                                         
------------------------------------------------------------                         
                                                                                     
Build time:   2022-08-05 21:17:56 UTC                                                
Revision:     d1daa0cbf1a0103000b71484e1dbfe096e095918                               
                                                                                     
Kotlin:       1.6.21                                                                 
Groovy:       3.0.10                                                                 
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021                
JVM:          18.0.2 (Oracle Corporation 18.0.2+9-61)                                
OS:           Windows 10 10.0 amd64                                                  

@thiagocferr
Copy link
Contributor Author

thiagocferr commented Oct 24, 2022

$ java -version
openjdk version "18.0.2" 2022-07-19
OpenJDK Runtime Environment (build 18.0.2+0)
OpenJDK 64-Bit Server VM (build 18.0.2+0, mixed mode)

And yes, I can run the project with gradle task "run" (and from the command line with ./gradlew run). The problem only affects when running with Intelij run config.


$ ./gradlew --version                                                    

------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------

Build time:   2022-08-05 21:17:56 UTC
Revision:     d1daa0cbf1a0103000b71484e1dbfe096e095918

Kotlin:       1.6.21
Groovy:       3.0.10
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          18.0.2 (Oracle Corporation 18.0.2+0)
OS:           Linux 5.15.74-3-MANJARO amd64

I'm also up-to-date with the main branch, with commit 349c879. And indeed, there's only a try command on line 84...

image

@koppor
Copy link
Member

koppor commented Oct 24, 2022

I will remove the IntelliJ run config in a PR - it does not run on my machine, too. 😇

The manual start can be triggered at Launcher.java:

grafik

Runs only with Gradle.


Does NOT work with IntellIJ:

grafik

grafik

I don't know about a quick fix here...

@thiagocferr
Copy link
Contributor Author

thiagocferr commented Oct 24, 2022

The problem with not having IntelliJ run config is that, as far as I know, it would not be possible to run the application in debugger mode within the IDE. So, wouldn´t it be a better option to just update the Intelij run configuration file?

@koppor
Copy link
Member

koppor commented Oct 24, 2022

Debug works here with Gradle without issues.

@koppor
Copy link
Member

koppor commented Nov 6, 2022

I worked on refining the guideline. It is currently under review at #9355.

You have to configure IntelliJ to use Gradle for Build and running - and "IntelliJ IDEA" for test:

grafik


IntelliJ creates the launch configurations. Check out following steps:

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants