Build in IntellJ - java.lang.ClassNotFoundException: org.jivesoftware.openfire.XMPPServer

Hello

I am following the instructions to build the project in IntelliJ and I am getting a class not found exception but it works when I run the script. From the github it says it should build inside of the IDE so I am unsure if I am missing a step. Thank you so much in advance!!!

IntelliJ IDEA:
Run -> Edit Configurations... -> Add Application
fill in following values
Name: Openfire
Use classpath of module: starter
Main class: org.jivesoftware.openfire.starter.ServerStarter
VM options (adapt accordingly):
-DopenfireHome="-absolute path to your project folder-\\distribution\\target\\distribution-base" 
-Xverify:none
-server
-Dlog4j.configurationFile="-absolute path to your project folder-\\distribution\\target\\distribution-base\\lib\\log4j2.xml"
-Dopenfire.lib.dir="-absolute path to your project folder-\\distribution\\target\\distribution-base\\lib"
-Dfile.encoding=UTF-8
Working directory: -absolute path to your project folder-
apply
java.lang.ClassNotFoundException: org.jivesoftware.openfire.XMPPServer
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:90)
	at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56)

My advise is to follow the instructions that we provide in https://download.igniterealtime.org/spark/docs/latest/documentation/ide-intellij-setup.html

thank for you for the suggestion but this does not work for the openfire server. These instructions may work for Spark but not for the source I am trying to run

I do the right-click on the ServerStarter.java class and it results in below. So it does not seem to compile correctly in IntelliJ

java.lang.ClassNotFoundException: org.jivesoftware.openfire.XMPPServer
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:90)
	at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56)

Ah, apologies - someone else was asking for Spark elsewhere, which is where I got confused.

There are similar guides for Openfire, but I don’t think they cover Intellij yet. There’s one for VSCode here: https://download.igniterealtime.org/openfire/docs/latest/documentation/ide-vscode-setup.html

Maybe that can provide some pointers.

You have to configure -VM options in IntelliJ as below.

Note: ByDefault IntelliJ does not show -Vm fields, Please enable it as by clicking Modify options.