There are many errors, but most seem to include: module java.base does not "opens java.lang" to unnamed module @17c1bced
NOTE: I also tried setting up the SDK prior to this, but ran into a different issue:
After running mvn openmrs-sdk:setup
Setting up a new server...
Specify server id (-DserverId) (default: 'server'): server
You can setup the following servers:
1) 2.x Distribution
2) Platform
3) 03 Distribution
Which one do you choose? [1/2/3]: 3
You can deploy the following versions of O3:
1) Reference Application 3.0.0-SNAPSHOT
2) Other...
Unable to find/resolve artifact. The following artifacts could not be resolved: org.openmrs.module:initializer-omod:jar:2.5.0 (absent): org.openmrs.module:initializer-omod:jar:2.5.0 was not found in https://mavenrepo.openmrs.org/public
Any help with getting setup with either approach (so that I can begin frontend development) would be appreciated!
I thought I did; I manually created a settings.xml file at ~/.m2/settings.xml with just the Mekom repository within an otherwise empty profile. During setup, my file ended up like this (see below). Nesting the repository within the active profile allowed me to continue with setup. Thanks!
After completing OpenMRS SDK setup, I ran mvn openmrs-sdk:run -DserverId=server and got the following error:
Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.1.0:run (default-cli) on project openmrs: Failed running Tomcat
I read that Tomcat is a requirement for manual installations of the backend, but is it also required for the SDK? Is Java 8 a requirement for both the SDK and manual installations?
Here is additional output (skipping some INFO and WARNING outputs):
Checking if port 8000 is in use... [free]
Unrecognized VM option 'MaxPermSize=512m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for OpenMRS 2.7.0-SNAPSHOT:
[INFO]
[INFO] OpenMRS ............................................ FAILURE [ 0.726 s]
[INFO] openmrs-tools ...................................... SKIPPED
[INFO] openmrs-test ....................................... SKIPPED
[INFO] openmrs-api ........................................ SKIPPED
[INFO] openmrs-web ........................................ SKIPPED
[INFO] openmrs-webapp ..................................... SKIPPED
[INFO] openmrs-liquibase .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.052 s
[INFO] Finished at: 2023-07-12T14:56:52-04:00
[INFO] ------------------------------------------------------------------------
Here is the stack trace:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.1.0:run (default-cli) on project openmrs: Failed running Tomcat
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed running Tomcat
at org.openmrs.maven.plugins.Run.runInFork (Run.java:230)
at org.openmrs.maven.plugins.Run.executeTask (Run.java:112)
at org.openmrs.maven.plugins.AbstractTask.execute (AbstractTask.java:201)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
@wikumc Would you be able to make another quick PR? Over in Run.java, we set a couple of memory-related parameters that actually haven’t been relevant since Java 8. They’re silently ignored on Java 8 and seem to be causing the above error. I think the code there can just be removed, but maybe we do need to do a check of the JDK version?
Thanks all. As @ibacher mentioned, my primary issue was the JDK version. After some research, I installed JDK 1.8 (Java 8) and was able to complete my manual installation.
For reference, this StackOverflow comment has a comprehensive guide to installing multiple versions of Java on your system.
Note: for those using Homebrew, brew install openjdk@8 only works on x86_64 architecture. For ARM, I used the zulu8 cask:
brew tap homebrew/cask-versions
brew install --cask zulu8