B4J Question JAR file is OK on WIN7(64bit) but NOK on WIN7(32bit)

Discussion in 'B4J Questions' started by petr4ppc, Oct 5, 2014.

  1. petr4ppc

    petr4ppc Active Member Licensed User

    Dear friends,

    please help me.

    I have b4j installed on my win7-64bit and my app (JAR file) I can run on this system,
    but I can't run it on win7-32bit.

    Please I have read forum but I have not found the clear solution.

    I am trying b4j with this version of JDK:
    :\Program Files (x86)\Java\jdk1.7.0_11\bin\javac.exe
    :\Program Files (x86)\Java\jdk1.7.0_65\bin\javac.exe

    Everything is OK on 64 bit but not on 32bit
    Which version of JDK is correct for both version of system = 64bit and 32bit?
    Thank you very much
    p4ppc
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It doesn't matter whether you use 32bit or 64bit JRE.

    Run the app from the command line with java -jar <yourjar> and see the error message.
     
  3. billzhan

    billzhan Active Member Licensed User

    I had similar issues before, jar apps crashed when started on an old laptop. It turned out that RAM was broken(tested by Memtest86+)
     
  4. petr4ppc

    petr4ppc Active Member Licensed User

    Dear Bilizhan - thank you for your reply

    Dear Erel - the error message is:

    Code:
    dbutils._executetableview (java line: 368)
    java.sql.SQLException: [SQLITE_ERROR] 
    SQL error or missing database (no such tab
    le: files)
            at org.sqlite.DB.newSQLException(DB.java:
    383)
            at org.sqlite.DB.newSQLException(DB.java:
    387)
            at org.sqlite.DB.throwex(DB.java:
    374)
            at org.sqlite.NativeDB.prepare(Native Method)
            at org.sqlite.DB.prepare(DB.java:
    123)
            at org.sqlite.PrepStmt.<init>(PrepStmt.java:
    42)
            at org.sqlite.Conn.prepareStatement(Conn.java:
    404)
            at org.sqlite.Conn.prepareStatement(Conn.java:
    399)
            at org.sqlite.Conn.prepareStatement(Conn.java:
    383)
            at anywheresoftware.b4j.objects.SQL.ExecQuery2(
    SQL.java:243)
            at b4j.example.dbutils._executetableview(dbutils.java:
    368)
            at b4j.example.main._formatfiles(main.java:
    1736)
            at b4j.example.main._appstart(main.java:
    244)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    93)
            at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    84)
            at b4j.example.main.start(main.java:
    35)
            at com.sun.javafx.application.LauncherImpl$
    5.run(Unknown Source)
            at com.sun.javafx.application.PlatformImpl$
    5.run(Unknown Source)
            at com.sun.javafx.application.PlatformImpl$
    4$1.run(Unknown Source)
            at com.sun.javafx.application.PlatformImpl$
    4$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.javafx.application.PlatformImpl$
    4.run(Unknown Source)
            at com.sun.glass.ui.InvokeLaterDispatcher$
    Future.run(Unknown Source)
            at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
            at com.sun.glass.ui.win.WinApplication.access$
    100(Unknown Source)
            at com.sun.glass.ui.win.WinApplication$
    3$1.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
    I took the file *.jar from PC with 64 bit and I am trying run this file on pc with 32 bit...
    I get this message

    Thank you very much
    Best regards
    p4ppc
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    The database is probably missing.

    It has nothing to do with 32bit vs. 64bit.
     
  6. petr4ppc

    petr4ppc Active Member Licensed User

    Thank you Erel and friends,

    I am doing something wrong. I have read on forum, that I can take the compiled file *.jar from OBJECTS folder and I can use this file on other computers. If I run myapp.jar on another comupter, then I see only new created DATA folder, but BIN and SRC folder is not created.

    But it looks, that I must take all data from OBJECTS folder=
    - BIN folder with files
    - DATA folder with files
    - SRC folder with files
    - and files in OBJECTS folder with myapp.jar

    This everything I need for running my app on other computers? It is true?
    It does it mean that I cant use only myapp.jar.

    Thank you very much
    Best regards
    p4ppc
     
  7. billzhan

    billzhan Active Member Licensed User

    It depends on your project, the resources(DB,img,text) accessed by your jar should also be copied to the right directories.

    Code:
    SQLmainlogin.InitializeSQLite("f://, "mydb.db",False)
    contmap = File.ReadMap(File.DirApp, "cont.txt")
    mydb.db (F disk) and cont.txt(File.DirApp->OBJECTS folder) should be copied to right directories


    This will help you to find out which resource is missing or if there is any bug (Line: xxx).
     
    Last edited: Oct 7, 2014
  8. Erel

    Erel Administrator Staff Member Licensed User

    The bin and src folders should never be distributed.

    If you have created your own file structure then you will need to recreate it on the customer computer. It will not be copied automatically.

    You can add the database to the Files tab and then copy it when your app starts for the first time.
     
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