how I run my first test in MacOS ?
[provide a description of the issue] I try to run my first Java test in exercism but I found this message 'BUILD FAILED' so what I have to do.
Environment
- Operating System:
- JDK version:
- Visual Studio Code version:
- Java extension version:
- Java Debugger extension version:
Steps To Reproduce
- [step 1]
- [step 2]
[attach a sample project reproducing the error] attach logs
Current Result
Expected Result
Additional Informations
I installed everything and the last step is running the test
Could you share us a sample project for reproducing the issue?
this what I found " exercism download --exercise hello-world --track java
Downloaded to /Users/ammar/Exercism/java/hello-world MacBook-Pro-alkhas-b-ammar:~ ammar$ Java 'Etl' /Users/johndoe/exercism/java/hello-world Error: Could not find or load main class Etl Caused by: java.lang.ClassNotFoundException: Etl MacBook-Pro-alkhas-b-ammar:~ ammar$ cd /Users/johndoe/exercism/java/hello-world -bash: cd: /Users/johndoe/exercism/java/hello-world: No such file or directory MacBook-Pro-alkhas-b-ammar:~ ammar$ gradle test Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
- What went wrong: Task 'test' not found in root project 'ammar'.
exercism download --exercise hello-world --track java
Downloaded to /Users/ammar/Exercism/java/hello-world MacBook-Pro-alkhas-b-ammar:~ ammar$ Java 'Etl' /Users/johndoe/exercism/java/hello-world Error: Could not find or load main class Etl Caused by: java.lang.ClassNotFoundException: Etl MacBook-Pro-alkhas-b-ammar:~ ammar$ cd /Users/johndoe/exercism/java/hello-world -bash: cd: /Users/johndoe/exercism/java/hello-world: No such file or directory MacBook-Pro-alkhas-b-ammar:~ ammar$ gradle test Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
- What went wrong: Task 'test' not found in root project 'ammar'.
Hi @Bugsh01, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Here are some steps to get your first Exercism Java test running on macOS:
-
Use the Gradle wrapper shipped with each exercise:
- Open a terminal in the exercise folder and run
./gradlew test(orgradlew teston Windows). - This will compile and execute the provided JUnit tests, printing failures or successes.
- If you don’t have execute permissions, first run
chmod +x gradlew.
- Open a terminal in the exercise folder and run
-
From within VS Code:
- Install the Java Test Runner extension (ms-vscode.vscode-java-test).
- Open the exercise folder (with
build.gradleandsrc/present). - Click the Test Explorer icon; you should see the JUnit tests.
- Click the Run icon next to a test class or method.
-
Common issues:
- If you see
BUILD FAILED, check the full Gradle output in the Terminal to identify compilation or dependency errors. - Make sure your
JAVA_HOMEpoints to a valid JDK (e.g.export JAVA_HOME=$(/usr/libexec/java_home)).
- If you see
Please attach the complete Gradle build log or VS Code Java output if you still see BUILD FAILED, so we can diagnose further.
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!