powered by Jive Software

Error importing Spark project to Eclipse

Hello. I wish to start contributing to the Spark project but I am unable to import this project in eclipse. I keep getting a message that an internal error occurred when trying to import the project. Also, I am not able to run this project on the terminal. I get this error https://pastebin.pl/view/0fa5bf83

Spark is a maven project, so it is better to clone the Github repo instead of manually downloading the source. You can read the html guide for eclipse included in documentation folder https://github.com/igniterealtime/Spark/tree/master/core/src/documentation

@Kang_Breder Welcome to the community! We look forward to your involvement. Please don’t hesitate to ask for help or resources if you need it. I can’t promise we’ll be able to provide it, but we will do our best :smiley:
Please consider joining us in our open chat channel open_chat@conference.igniterealtime.org or web client. https://www.igniterealtime.org/support/group_chat.jsp

Hello @wroot I actually cloned the repo before performing a run command.

Thank you @speedy. I still need help running the Spark

Have you tried to follow this document? https://htmlpreview.github.io/?https://github.com/igniterealtime/Spark/blob/master/core/src/documentation/ide-eclipse-setup.html

Yes I followed that document. I have tried all possible means but it still doesn’t work. I have also done that with vs code and that still doesn’t work. It is really frustrating.

Here is a picture of the erros I get when I import to eclipse

Can I please get on a call with someone to help me resolve this problem directly?

I have tried that document with Eclipse and i get the same errors. I don’t know what they mean, i am not a developer myself. I just remember that when Spark switched to Maven i was not able to make it work in Eclipse, so i started to use IntelliJ (with Git, not with local source code). As i’ve said, i am not a dev, so i was using it mostly just to run Spark from code to test patches provided by someone. But it was enough for me. If you want, i can check my notes, test it this way (IntelliJ + Git) and give them to you. Unless you really want to use Eclipse and local source.

This is a small community of volunteers mostly doing something here in their spare time. You can try asking in the group chat, but i don’t think anyone will want or have time to get on the call. Also all developers here work with Git, nobody is working with local source code, so not sure if they will be able to figure this out. Most are not using Eclipse either (some use command line, some IntelliJ). This guide was provided by a temporary contributor a few years ago. Maybe it was working this way at that point, but not anymore with the current Eclipse version.

Thank you for your response. I will install IntelliJ and try importing and running from there. Also, I have cloned the source code from git. So I think I am working with git too. I will be glad if I can have the notes you suggested. I also think there is a documentation for IntelliJ, I hope it works.

That is the error I get on intellij

I applaud you for sticking with it. Issues like these can be daunting. The build works for me. I wonder what’s different for you.

One thing that strikes me as odd in your screenshot, is that you seem to have only one module (listed on the right hand panel in your screenshot). There should be a lot more. Compare it with what the manual shows in https://download.igniterealtime.org/spark/docs/latest/documentation/ide-intellij-setup.html

Look at this image from that guide:

The right hand side of the screen shows a lot more modules. One of this will provide the emoticons that your IDE cannot find.

Have you followed this guide?

Yes @guus. That is exactly the guide I am following but when I upload the project to the IDE, i get everything underlined in red and that’s what i get. I get only one module listed as part of maven projects.

I think you went too deep when opening a project and selected pom.xml inside the core, but you have to select pom.xml which is one step higher in the root folder of the source. I did that and it shows all the components on the right and nothing is underscored. In new IntelliJ there is no Import project anymore, so i just selected Open and went to that pom.xml. You also have to have JDK 1.8 installed to be able to run Spark via Launcher. I am using Adopt OpenJDK 1.8 64-bit. And i had to go to File > Project Structure and select JDK 1.8 there as SDK, as it was empty. I am using Windows though, you seem to use macOS. Not sure if this works the same there.

I haven’t tried yet with the Git setup. You said you have cloned it, but have you then downloaded it to your computer and opened it via File > Open? In that case you are still working with a local copy. To work via Git you have to fork Spark on GitHub and then connect your fork in IntelliJ, so then you can merge changes you do to your fork on GitHub and then can create pull requests against our main repository. That is, if you plan to contribute to Spark project :slight_smile:

For Git: i have installed Git for Windows. Then in IntelliJ selected From VCS. Then put https://github.com/wrooot/Spark as URL and selected a folder to store. It cloned my fork and imported all components. Again, nothing underscored, all components present in the right window and i can Run Spark via Launcher.

Although it shows this error right after the import (in both local and Git cases)

Could not find artifact org.igniterealtime.spark.plugins:assembly-descriptor:pom:2.9.5-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots)
But i am able to run Spark anyway.
If you authorize your IDE with GitHub, you can then edit code and commit and push to your fork on GitHub. And then you can go to your fork on GitHub and create a pull request with your changes.

1 Like

I do have the maven modules now on the right but I am not still able to start Spark from the Startup file in the launcher. Here is a screenshot

Can you show screenshot of what it shows when you right click Startup.java or when you open Run menu at the top when Startup.java is selected? It should show “Run Startup.main()”. If it doesn’t show that, when JDK is not configured. Then go to File > Project Structure and select JDK 1.8 there as SDK, hit OK and try Startup.java again.

It is difficult for me to take a screenshot when I right click on the file because I am using spectacle to take screenshots. The printscr key isn’t working.

I just did that. I had not selected any SDK before