I would like to start my java code by double-click.Therefore I have exported my java project in Eclipse as "Runnable .jar". The file has the java icon, but when I try to start it, an error appears:
"The Java JAR file "test.jar" could not be launched. Check the Console for possible error messages."
But there is nothing in the console.
I am running OSX 10.14.5, Java 12 in Eclipse as JDR, and on my Mac there is Java 8 installed.
Running java -jar /Users/Bob/Desktop/test.jar
does start the program.
package testMAC;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("It works!");
}
}
The program should start the console and print "It works!".