i'm trying to export a Runnable Jar in order to run my project with .bat file, however when trying to export a Runnable jar it fails with massage:
"Jar creation failed. See details for additional information." < < Details : No resources selected. See details for additional information. Could not find main method from given launch configuration.
Using Windows Server 2012, newest eclipse, jdk and jre. cleaning didn't change anything, nor copying the project to a new one.
Downgrading to 1.8 didn't help as well, I looked at some suggestions for the last couple of hours, none helped.
Of-curse I have static void main(String[] args) in my Runner.java class, and if you click "Run" (with same Run Configuration) from Eclipse it works perfect.
Couldn't find a solution as of now.
6/12 - Update: Adding screenshots of the export process as howlger asked.
I've also tried new workspace according to Akshay Bahadur's suggestion, same result.
https://s3.amazonaws.com/stackover/Screenshot_141.png
https://s3.amazonaws.com/stackover/Screenshot_142.png
https://s3.amazonaws.com/stackover/Screenshot_143.png
6/12 - 2nd Update: Adding Run Configuration: https://s3.amazonaws.com/stackover/Screenshot_149.png
7/12 - 3nd Update: Adding About Eclipse:
Eclipse IDE for Java Developers Version: Oxygen.1a Release (4.7.1a) Build id: 20171005-1200 OS: Windows Server 2012 R2, v.6.3, x86_64 / win32
https://s3.amazonaws.com/stackover/Screenshot_155.png
and the main() function is plain Java - no Maven or Gradle:
public static void main(String[] args) {
boolean errorNotHappened = true;
boolean errorWithMailNotHappened = true;
boolean performDownload = true;
boolean performEmailSent = true;
boolean performDataManipulation = true;
System.out.println("***~~~*** Starting job. If you want more details - turn on debug mode");
//Downloader d = new Downloader();
printMsg("Date to use with files: "+getDateToUse());
printMsg("Write mail for date: "+getYasterdayNiceDate());
if (performDownload)
{
Downloader d = new Downloader();
d.connectAnd(); //connect to pair server
errorNotHappened = d.downloadFiles();
d.disconnectFromServer();
}
if (errorNotHappened && performDataManipulation)
{
Manipulator m = new Manipulator();
errorNotHappened = m.work();
m.terminateManipulator();
}
if (performEmailSent)
{
GoogleMailer gmail = new GoogleMailer();
gmail.startMailingService();
if (errorNotHappened)
errorWithMailNotHappened = gmail.sendMailWithAttach();
else
gmail.sendFailedMail();
if(!errorWithMailNotHappened)
{
gmail.sendFailedMail();
}
}
System.out.println("***~~~*** Job ended.");
}