Unable to JAR on Mac using Eclipse or VS Code

58 views Asked by At

I am a student and I am trying to JAR a java project using a GUI. The project works in eclipse, however when I try and jar the code my macbook cannot gives me this error:

Java Application launch Failed

I have verified that I am on Java 8 and have tried running the JAR from command-line to no avail. I have also tried to JAR many projects on this computer however it only works once I transfer the files to a Windows computer. I have also tried to jar projects from VS Code which doesn't work.

input: java -jar VisualBinarySearchTree.jar output

(this is the jar I want to access)

Error:

Unable to access jarfile VisualBinarySearchTree.jar

My Java version is 1.8

The JAR also doesn't work if I just double click on it and the jar is being created through eclipse by export>RunnableJarFile>extract libraries.

1

There are 1 answers

0
Arjun On

I tried using the pathname to run the jar from the terminal which gave me a string of errors. I then redownloaded JDK 21 which worked. Thank you greg-449 for the help which lead me to the answer.