B4J Tutorial Create Windows native executables (exe files)

Discussion in 'B4J Tutorials' started by Erel, Dec 19, 2013.

Thread Status:
Not open for further replies.
  1. hookshy

    hookshy Well-Known Member Licensed User

    https://www.dropbox.com/s/3oy44z5cg5xdiz4/Amara.jar?dl=0
    Can you test my jar file ... I have reinstalled java SE development kit for windows 64 and I can not open it !

    I guess the main reason is that I am using http utils 2.... !!
    The example from the library thread is not opening olso on double click on jar file !!!
     
    Last edited: Sep 4, 2014
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. hookshy

    hookshy Well-Known Member Licensed User

    I have fixed the problem by copying code to another httputils2 example ...
    Hope I will never met this problem again
     
    Last edited: Sep 5, 2014
  4. klakier2121

    klakier2121 New Member

    Hello, I have 1.8.0 version of java. When i want to create exe file I get: Error: invalid or corrupt file myfile.exe. I am using launch4j. When I am using java -jar myfile.jar command it says the same error. Also added:
    #CommandLineArgs:
    #MergeLibraries: true
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the output of java -jar <your jar> ?
     
  6. klakier2121

    klakier2121 New Member

    Here:

    [​IMG]

    I have the newest B4J program. My java-version

    Code:
    C:\Users\Dom>java -version
    java version 
    "1.8.0_65"
    Java(TM) SE Runtime Environment (build 
    1.8.0_65-b17)
    Java HotSpot(TM) Client VM (build 
    25.65-b01, mixed mode, sharing)
     
    Last edited: Jan 20, 2016
  7. Erel

    Erel Administrator Staff Member Licensed User

    This issue is not related to this thread.

    Please start a new thread. If possible upload the jar fie.
     
  8. klakier2121

    klakier2121 New Member

    Solved. I had to change to Release mode :p
     
  9. Harris

    Harris Well-Known Member Licensed User

    I have RDC and my ABM jar files running on a Win 2012 R2 Server.
    I would like to make them run as services so when the server reboots, they will start up automatically.

    Would I use this tool to create exe's to accomplish this?

    Thanks
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    You don't need to convert the jar to exe for this. You can run it at startup by running java with the required arguments (java -jar <your jar>).
     
  11. Harris

    Harris Well-Known Member Licensed User

    Would this hold true for batch files as well (such as RunRLC.bat)?
    This way, I could see a DOS cmd window with results of each service running when I Remote Desktop into the server in question...

    Thanks
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    Yes, you can use Windows scheduler to run batch files.
     
  13. Harris

    Harris Well-Known Member Licensed User

    Thanks for very prompt reply. I shall do.

    Side Note:

    I learn more from the B4X community than Google searches and sourceforge combined (when in context)!
    The expansion of B4X has broadened the scope of questions asked, and submitted answers from professionals on the subject matter.

    It may take many tries to submit the relevant "Search" text in B4X, but persistence pays off. One needs to re-phrase the search to list relevant results. This I do many times until I exhaust possible phrases. Often I have found the answer in "Similar Threads" when I need to dig deeper.

    I always (try) to search before I ask for help. I see where you good folks link a post to the same or similar question.
    I only wonder why my search didn't return the same post(s)? (not posed/framed correctly).

    Cheers.
     
  14. Sami Zerroog

    Sami Zerroog New Member

    Hello every one I completed the steps of converting the .jar file to .exe file.
    When I run the .exe file I get the following error msg. Any help please:

    The other question I have is how do I include the config.properties file to be wrapped with .jar file??
    Please not this is SWING application and I'm using Netbeans IDE


    Thank you.

    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource
    at hivpapp.DBConnection.DBConnection.getConnection(DBConnection.java:40)
    at hivpapp.view.Login.LoginButtonActionPerformed(Login.java:247)
    at hivpapp.view.Login.access$300(Login.java:29)
    at hivpapp.view.Login$4.actionPerformed(Login.java:106)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 40 more
     
    Last edited: Jul 18, 2016
  15. Erel

    Erel Administrator Staff Member Licensed User

    Did you create the program with B4J? B4J It doesn't look like a B4J program based on the error message.
     
  16. chardenal

    chardenal Member Licensed User

    Hello,

    I have followed the instruction, I have no error that appears, but my file.exe doesn't start...

    How know where is the problem?

    Thanks.
     

    Attached Files:

  17. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice