/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license */
package com.mycompany.mavenproject2;
/** * * @author User1222 */ public class Mavenproject2 {
public static void main(String[] args) {
int[] a = { 4, 2, 1, 5, 3 }; Arrays.sort(a); System.out.println(Arrays.toString(a)); System.out.println("Hello World!"); } } Но высвечивает ошибку
Exception in thread "main" java.lang.RuntimeException: Uncompilable code - cannot find symbol symbol: variable Arrays location: class com.mycompany.mavenproject2.Mavenproject2 at com.mycompany.mavenproject2.Mavenproject2.main(Mavenproject2.java:1) 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:982)
------------------------------------------------------------------------ BUILD FAILURE ------------------------------------------------------------------------ Total time: 3.416 s Finished at: 2023-05-15T11:06:43+04:00 ------------------------------------------------------------------------ Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project mavenproject2: 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.
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
*/
package com.mycompany.mavenproject2;
/**
*
* @author User1222
*/
public class Mavenproject2 {
public static void main(String[] args) {
int[] a = { 4, 2, 1, 5, 3 };
Arrays.sort(a);
System.out.println(Arrays.toString(a));
System.out.println("Hello World!");
}
}
Но высвечивает ошибку
Exception in thread "main" java.lang.RuntimeException: Uncompilable code - cannot find symbol
symbol: variable Arrays
location: class com.mycompany.mavenproject2.Mavenproject2
at com.mycompany.mavenproject2.Mavenproject2.main(Mavenproject2.java:1)
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:982)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.416 s
Finished at: 2023-05-15T11:06:43+04:00
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project mavenproject2: 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/display/MAVEN/MojoExecutionException
что не так то?