0

I am running into configuration (? I think) problems when doing the very first problem on MOOC.Fi exercise. It's a simple Hello World program.

Here's the error I keep getting:

Error: Could not find or load main class Sandbox
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:185)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:181)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (default-cli) on project Part01_01.Sandbox: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

I have read the help link, and tried the suggestions, but haven't had success.

Alexander Ivanchenko
  • 25,667
  • 5
  • 22
  • 46
  • Can you please run the maven goal with command line argument `-X` enabled for debug logging? If the executed process is returning exit code `-1`, that means that it did run, but did not normally exit (that would be exit code 0). Please also include the full `pom.xml` configuration, so we can see your project and the executable you're trying to run. And please also the java + maven version you're using, and the .java source files you've created. Currently the `exec plugin` is telling you that it can not find or load your `Sandbox` main class, for that we need more context. – slindenau Jul 22 '22 at 10:25
  • I would really love to, but I don't even know what you are talking about. Total newbie here. I don't want to take too much of your time, so if it's too long to explain in more detail, I understand. – jbrydeWWP Jul 23 '22 at 12:59
  • Not a problem, but currently it's very difficult to help. The courses on `mooc.fi` are not fully visible without creating an account. And even if we could see them, we don't know if you applied them exactly 1:1 on your local environment. The `Sandbox` seems to be the initial setup to get your `Netbeans` IDE working, and that part is failing? Try checking out the [following](https://stackoverflow.com/questions/20034377/netbeans-error-could-not-find-or-load-main-class) similar [questions](https://stackoverflow.com/questions/18814602/error-could-not-find-or-load-main-class-netbeans-and-java). – slindenau Jul 23 '22 at 14:53
  • You can start by adding the contents of your `Sandbox.java` file to the question as text, using the `code` formatting option. – slindenau Jul 23 '22 at 15:02
  • Thank you for all your help. I have worked around this issue without truly fixing it. But it's ok, because I don't really need it to work in the manner specified. I have decided to use VS code and made some modifications and it works fine. – jbrydeWWP Jul 24 '22 at 15:10
  • How can I close this comment so that others don't waster their time on it. Trying to be respectful of other's time. Thanks. – jbrydeWWP Jul 24 '22 at 15:11

0 Answers0