Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Jar file not running on double click.
Jar file not running on double click. [message #1589416] Wed, 28 January 2015 12:31 Go to next message
Swati Sharma is currently offline Swati SharmaFriend
Messages: 4
Registered: January 2015
Junior Member
Hi,

After building the javafx project I am getting the following ...

No base JDK. Package will use system JRE.
The jar libs\js-14.jar has a main class org.mozilla.javascript.tools.shell.Main that does not match the declared main com.msat.frameworks.keyword_driven.iaf.iAF_UI
The jar libs\selenium-server-standalone-2.35.0.jar has a main class org.openqa.grid.selenium.GridLauncher that does not match the declared main com.msat.frameworks.keyword_driven.iaf.iAF_UI
BUILD SUCCESSFUL
Total time: 4 seconds

The jar file gets created successfully. But it doesn't run on double click or even by using CMD prompt.

[Note: I have tried creating small applications without using external jars and they worked perfectly fine.]

I have attached the build.xml file.
Any help would be much appreciated. Thanks in advance.
  • Attachment: build.xml
    (Size: 7.33KB, Downloaded 223 times)

[Updated on: Thu, 29 January 2015 06:24]

Report message to a moderator

Re: Jar file not running on double click. [message #1592034 is a reply to message #1589416] Thu, 29 January 2015 22:06 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you try running on the console with java -jar which give you more
information what is wrong.

Tom

On 28.01.15 16:00, Swati Sharma wrote:
> Hi,
>
> I am facing a similar problem:
>
> No base JDK. Package will use system JRE.
> The jar libs\js-14.jar has a main class org.mozilla.javascript.tools.shell.Main that does not match the declared main com.msat.frameworks.keyword_driven.iaf.iAF_UI
> The jar libs\selenium-server-standalone-2.35.0.jar has a main class org.openqa.grid.selenium.GridLauncher that does not match the declared main com.msat.frameworks.keyword_driven.iaf.iAF_UI
> BUILD SUCCESSFUL
> Total time: 4 seconds
>
> The jar file gets created successfully. But it doesn't run on double click or even by using CMD prompt.
>
> [Note: I have tried creating small applications without using external jars and they worked perfectly fine.]
>
> I have attached the build.xml file.
> Any help would be much appreciated. Thanks in advance.
>
Re: Jar file not running on double click. [message #1597598 is a reply to message #1592034] Mon, 02 February 2015 12:14 Go to previous messageGo to next message
Swati Sharma is currently offline Swati SharmaFriend
Messages: 4
Registered: January 2015
Junior Member
Yes I did,

PFA the screenshot with the error details.

Thanks,
Swati

  • Attachment: Capture.PNG
    (Size: 43.93KB, Downloaded 295 times)
Re: Jar file not running on double click. [message #1597619 is a reply to message #1597598] Mon, 02 February 2015 12:32 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
so

a) You miss to package your fxml-Files with the app
b) You are using relative paths in your java code who don't work in a
jar filesystem

What does the code look like iAF_UI.start()?

Tom

On 02.02.15 13:14, Swati Sharma wrote:
> Yes I did,
>
> PFA the screenshot with the error details.
>
> Thanks,
> Swati
>
>
Re: Jar file not running on double click. [message #1598806 is a reply to message #1597619] Tue, 03 February 2015 07:01 Go to previous messageGo to next message
Swati Sharma is currently offline Swati SharmaFriend
Messages: 4
Registered: January 2015
Junior Member
Hi Tom,

Thanks

The code in Main looks something like this:


public class iAF_UI extends Application {

public static int threadcount1;
public static String jarDir;
public static iAF_Controller controller;
private Stage stage;
private BorderPane root;

@Override public void start(final Stage stage) throws Exception {

CodeSource codeSource = iAF_UI.class.getProtectionDomain().getCodeSource();
File jarFile = new File(codeSource.getLocation().toURI().getPath());
jarDir = jarFile.getParentFile().getPath();

FXMLLoader loader = new FXMLLoader();
loader.setLocation(iAF_UI.class.getResource("iAF_GUI.fxml"));

root = (BorderPane) loader.load();
controller = (iAF_Controller)loader.getController();

controller.setMainApp(this);

Platform.setImplicitExit(false);
//stage.setMaximized(true);
stage.setTitle("IAF-Draft!");
stage.setScene(new Scene(root));
stage.initStyle(StageStyle.UNIFIED);
stage.getIcons().add(new Image(getClass().getResourceAsStream("logo.png")));
stage.show();
stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent t) {
Platform.exit();
System.exit(0);
}
});



}

public Stage getStage() {
return stage;
}

public static void main(String[] args) { launch(args); }
}



Thanks,
Swati

[Updated on: Tue, 03 February 2015 07:18]

Report message to a moderator

Re: Jar file not running on double click. [message #1598812 is a reply to message #1598806] Tue, 03 February 2015 07:07 Go to previous messageGo to next message
Swati Sharma is currently offline Swati SharmaFriend
Messages: 4
Registered: January 2015
Junior Member
I would also like to bring this to your notice that I did create a few small applications before in which I created the package and called the fxml file in Main exactly the same way. They all seem to work perfectly fine.
The only difference i could see while building it, was all the external jar files that i added to this one.
And the following build error:
The jar libs\js-14.jar has a main class org.mozilla.javascript.tools.shell.Main that does not match the declared main com.msat.frameworks.keyword_driven.iaf.iAF_UI
The jar libs\selenium-server-standalone-2.35.0.jar has a main class org.openqa.grid.selenium.GridLauncher that does not match the declared main com.msat.frameworks.keyword_driven.iaf.iAF_UI

Do you think this could be the problem? If yes, what do you suggest I should do as i need these jar files in my application.

Thanks for helping me here. Smile

Swati
Re: Jar file not running on double click. [message #1598854 is a reply to message #1598806] Tue, 03 February 2015 07:46 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you inspect the jar file and is the fxml file there? Do you by
chance have a typo with upper/lower case which works in eclipse because
the windows filesystem is caseinsenstive?

Tom

On 03.02.15 08:01, Swati Sharma wrote:
> Hi Tom,
>
> Thanks
> The code in Main looks something like this:
>
>
> public class iAF_UI extends Application {
>
> public static int threadcount1;
> public static String jarDir;
> public static iAF_Controller controller;
> private Stage stage;
> private BorderPane root;
> @Override public void start(final Stage stage) throws Exception {
>
> CodeSource codeSource =
> iAF_UI.class.getProtectionDomain().getCodeSource();
> File jarFile = new
> File(codeSource.getLocation().toURI().getPath());
> jarDir = jarFile.getParentFile().getPath();
>
> final FXMLLoader loader = new
> FXMLLoader(getClass().getResource("iAF_GUI.fxml"));
> root = (BorderPane) loader.load();
> controller = (iAF_Controller)loader.getController();
> controller.setMainApp(this);
>
> Platform.setImplicitExit(false);
> //stage.setMaximized(true);
> stage.setTitle("IAF-Draft!"); stage.setScene(new
> Scene(root));
> stage.initStyle(StageStyle.UNIFIED);
> stage.getIcons().add(new
> Image(getClass().getResourceAsStream("logo.png")));
> stage.show();
> stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
> @Override
> public void handle(WindowEvent t) {
> Platform.exit();
> System.exit(0);
> }
> });
>
>
>
> }
>
> public Stage getStage() {
> return stage;
> }
>
> public static void main(String[] args) { launch(args); }
> }
>
>
> Thanks,
> Swati
>
Previous Topic:How to convert 0.8.1 Juno project to 1.2.0 Luna?
Next Topic:Unable to retrieve the bundle from ... at.bestsolution.e4.theme.css ...
Goto Forum:
  


Current Time: Thu Jan 16 20:02:56 GMT 2025

Powered by FUDForum. Page generated in 0.05763 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top