Peter Winzer :
I am trying to setup Eclipse with Java 9 but the Export -> Runnable JAR file is not working since it can't find the main method.
Context:
Windows 10
Eclipse IDE version Oxygen 1a Release (4.7.1a) Build: 20171005-1200
JDK 9.0.1 and JRE 9.0.1 installed & setup in Eclipse
What I did:
- File -> New Java Project
- Click on "Finish"
Edited Main.java to following code:
package com.application;
public class Main {
public static void main(String[] args) {
System.out.println(System.getProperty("java.version"));
}
}
Run -> No errors.
Console log result: "9.0.1"
Now I want to export the code to a Runnable JAR: Right click on the Project -> Export -> Runnable JAR file
So I went to the Run Configurations but the Main class is defined:
With Java 8 there was no problem exporting the jar following the steps above.
What do I have to do, to use the "export to Runnable JAR file" in Java 9?
Zerthimon :
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=467044&siteId=1