B4J Question B4JPackager how to create an installer package (Java 8)

ThRuST

Well-Known Member
Licensed User
Longtime User
Hi! I'm trying to create an installer for my Java 8 app using B4Jpackager 8 since my app requires Java 8. However when browsing to the java RNE 8 dmg it seems to be wrong even though I've set read/write rights for the file. I've put the neccessary files in a subfolder under documents folder and browsed to each file.

1658351063957.png


When clicking Build this shows up

Error:
1658350298881.png


1658350855855.png


I'm using macOS El Capitan on vmWare workstation 15.
Any ideas what's causing this?
 
Last edited:

ThRuST

Well-Known Member
Licensed User
Longtime User
@Erel I cannot use Java 11 simply because the code that lists the drives only works with Java 8.
Maybe I should post a new question about this. Listing of drives might work also on Mac when using Java 11 not sure.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
@Erel Here's the code that I use to list the drives. It only works using Java 8 and on Windows.
It's associated with the floating menu library. So I just copied from my project.

init:
Public DrivesList As List

listdrives:
' List Available Drives
        Dim fsv1 As JavaObject
        fsv1.InitializeStatic("javax.swing.filechooser.FileSystemView")
        DrivesList.Initialize
           
        Dim Namelenght1 As Int
        Dim Tstring1 As String
   
        For Each drive1 As Object In ListRoots
            Tstring1 = drive1
            MainMenu.Add(FloatingMenu_Drives.MenuText2(drive1 & " " & fsv1.RunMethodJO("getFileSystemView",Null).RunMethod("getSystemDisplayName",Array(drive1))).SetTag("Unit " & drive1).SetGraphic(FloatingMenu_Drives.NewImage(File.DirAssets, "Harddrive.png")))
            DrivesList.Add(drive1)
        Next
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Roger, you are missing the sub ListRoots from your other thread here: https://www.b4x.com/android/forum/threads/list-available-drive-names.100827/#content

It is working under java 11 for me with that sub added.

B4X:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 600
#End Region

Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private xui As XUI
    Private Button1 As B4XView
    Private DrivesList As List
    
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1")
    MainForm.Show
    
    ' List Available Drives
    Dim fsv As JavaObject
    fsv.InitializeStatic("javax.swing.filechooser.FileSystemView")
    For Each drive As Object In ListRoots
        Log(drive)
        Log(fsv.RunMethodJO("getFileSystemView",Null).RunMethod("getSystemDisplayName",Array(drive)))
    Next
End Sub

Sub ListRoots As List
    Dim jo As JavaObject
    Dim o() As Object = jo.InitializeStatic("java.io.File").RunMethod("listRoots", Null)
    Return o
End Sub

Sub Button1_Click
    xui.MsgboxAsync("Hello World!", "B4X")
End Sub
 
Upvote 1
Top