Page 1 of 2 12 LastLast
Results 1 to 20 of 23
  1. #1
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Problem running jar file


    I also have problem with running JAR. After exporting, program dont works. Do i did something wrong?

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,389
    Blog Entries
    7
    Rep Power
    25

    Default Re: Running a jar in a batch file

    Quote Originally Posted by asdfg View Post
    I also have problem with running JAR. After exporting, program dont works. Do i did something wrong?
    Does that generated .jar file have a proper MANIFEST entry? (you can check it by renaming .jar to .zip and opening it with a zip tool).

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  3. #3
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file

    extract.bmp
    So I have extracted that file with winRAR and show everything what I got. Tells something?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: Running a jar in a batch file

    program dont works.
    To get the error message,
    Open a command prompt window and enter the command:
    java -jar <TheJarFIleNameHere>.jar
    copy the contents of the command prompt window and paste it here.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file

    The system cannot find the file specified.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: Running a jar in a batch file

    Please copy the full contents of the command prompt window and paste it here so we can see exactly what was entered and the complete text of the computer's response.
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,389
    Blog Entries
    7
    Rep Power
    25

    Default Re: Running a jar in a batch file

    Quote Originally Posted by asdfg View Post
    extract.bmp
    So I have extracted that file with winRAR and show everything what I got. Tells something?
    Yep, it tells me that you're even too lazy to give us proper information; I asked for the MANIFEST entry and without reading anything you give us a bloody .bmp file; you don't deserve any help.

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  8. #8
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file

    I even dont know what is it " the MANIFEST entry"

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: Running a jar in a batch file

    Can you do what was asked in post#10 and #12 so we can see exactly what happens when the jar file is executed?
    If you don't understand my response, don't ignore it, ask a question.

  10. #10
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,389
    Blog Entries
    7
    Rep Power
    25

    Default Re: Running a jar in a batch file

    Quote Originally Posted by asdfg View Post
    I even dont know what is it " the MANIFEST entry"
    So you make your IDE do things you understand zilch about and when it doesn't work, you start complaining here, without being able to give proper information? tsk, tsk ...

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  11. #11
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file


  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: Running a jar in a batch file

    Please copy the contents of the command prompt window and paste it here. Images are not good because text can not be copied from an image to paste in a response.
    If you don't understand my response, don't ignore it, ask a question.

  13. #13
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,389
    Blog Entries
    7
    Rep Power
    25

    Default Re: Running a jar in a batch file

    Quote Originally Posted by asdfg View Post
    Since when is <try>.jar a valid jar file name?

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  14. #14
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: Running a jar in a batch file

    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    If you don't understand my response, don't ignore it, ask a question.

  15. #15
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Trynys>java -jar try.jar
    Exception in Application start method
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.launchAppl icationWithArgs(Lau
    ncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchAppl ication(LauncherImp
    l.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
    Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchAppl ication1(LauncherIm
    pl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$lau nchApplication$155(
    LauncherImpl.java:182)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: Bulve.jpg (The system cannot find the
    file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at naujaSavaite.Testas.start(Testas.java:41)
    at com.sun.javafx.application.LauncherImpl.lambda$lau nchApplication1$162
    (LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$run AndWait$175(Platfor
    mImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$nul l$173(PlatformImpl.
    java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$run Later$174(PlatformI
    mpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run( InvokeLaterDispatch
    er.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Nativ e Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$14 8(WinApplication.ja
    va:191)
    ... 1 more
    Exception running application naujaSavaite.Testas

    C:\Users\Trynys>

  16. #16
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: Running a jar in a batch file

    Caused by: java.io.FileNotFoundException: Bulve.jpg (The system cannot find the file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at naujaSavaite.Testas.start(Testas.java:41)
    The program can not find the file: Bulve.jpg
    at line 41 in the FileInputStream constructor.

    Where is the file located? It needs to be in the current directory when the jar file is executed.
    If you don't understand my response, don't ignore it, ask a question.

  17. #17
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file

    Bulve.jpg is located inside eclipse project. C:\44\naujaSavaite
    Runnable JAR file on desktop.

  18. #18
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: Running a jar in a batch file

    C:\Users\Trynys>java -jar try.jar
    The program is looking in the C:\Users\Trynys folder for the missing file.
    I assume that is where the jar file is located.
    Try copying the file to the folder with the jar file.
    Last edited by Norm; 01-08-2017 at 11:04 PM.
    If you don't understand my response, don't ignore it, ask a question.

  19. #19
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file

    Yes, now it works.
    So the thing was that I was placed one try.jar file on desktop and another in try.jar in C:\Users\Trynys

  20. #20
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: Running a jar in a batch file

    I meant works, if I launch from cmd. But if I right click try.jar and open with java. Its still nothing.

Page 1 of 2 12 LastLast

Similar Threads

  1. problem running compiled class file
    By SnakeDoc in forum New To Java
    Replies: 6
    Last Post: 04-14-2012, 12:54 AM
  2. Replies: 7
    Last Post: 12-18-2011, 05:13 AM
  3. Weird problem running a batch file
    By d3n1s in forum Advanced Java
    Replies: 7
    Last Post: 06-19-2011, 01:34 AM
  4. Running jar file.
    By yogi1410 in forum Advanced Java
    Replies: 1
    Last Post: 01-11-2010, 11:59 AM
  5. Replies: 0
    Last Post: 08-26-2009, 01:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •