Hello! I am a beginner, along with introducing myself, I have the following problem in my basic java code. I think everything is fine, but for some reason the machine gives me an error...
package com.mycompany.holamundo; import javax.swing.JOptionPane; /** */public class Holamundo { public static void main (String [] args){ String cadena; int entero; char letra; double decimal; cadena = JOptionPane.showInputDialog("Digite cadena"); entero = Integer.parseInt(JOptionPane.showInputDialog("Digite entero")); letra = JOptionPane.showInputDialog("Digite caracter").charAt(0); decimal = Double.parseDouble(JOptionPane.showInputDialog("Digite decimal")); JoptionPane.showMessageDialog(null,"La cadena es"+cadena); JoptionPane.showMessageDialog(null,"La cadena es"+entero); JoptionPane.showMessageDialog(null,"El numero es"+letra); JoptionPane.showMessageDialog(null,"El decimal es"+decimal); } }
Error message:
----------------------< com.mycompany:Holamundo >-----------------------
Building Holamundo 1.0-SNAPSHOT
from pom.xml
--------------------------------[ jar ]---------------------------------
--- resources:3.3.1:resources (default-resources) @ Holamundo ---
skip non existing resourceDirectory C:\Users\danie\OneDrive\Documents\NetBeansProjects \Holamundo\src\main\resources
--- compiler:3.11.0:compile (default-compile) @ Holamundo ---
Changes detected - recompiling the module! :source
Compiling 3 source files with javac [debug target 22] to target\classes
--- exec:3.1.0:exec (default-cli) @ Holamundo ---
Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
at com.mycompany.holamundo.JoptionPane.showMessageDia log(JoptionPane.java:14)
at com.mycompany.holamundo.Holamundo.main(Holamundo.j ava:24)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInt ernal (DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:1000)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:947)
at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:471)
at org.apache.maven.plugin.DefaultBuildPluginManager. executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.d oExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.d oExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.a ccess$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1 .run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrat egy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModul eBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModul eBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.single threaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStart er.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.in voke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
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)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 16.822 s
Finished at: 2024-08-03T10:23:17-04:00
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:exec (default-cli) on project Holamundo: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/d...utionException
If anyone can help me, thank you!