B4J Question Trying to "clone" my app on a MAC.

Gary Miyakawa

Active Member
Licensed User
Longtime User
I've trying to clone my process on a MAC and keep getting the message that my jar file can not be found in the directory. Question is, how to I find what directory my .jar is running from ?

I've tried using both Shell and showexternaldocument and neither one works. The Shell works find on a windows platform.

Basically my code is:

B4X:
    shl.Initialize("Clone", "ShellTesting.jar", Null)

What am I missing ?

Thanks,

Gary Miyakawa
 

Gary Miyakawa

Active Member
Licensed User
Longtime User
Yes, I tried that too... Got the same error. (see the enclosed file).
Here is my code... (mostly from your example a while back)..

B4X:
#Region  Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 400
#End Region
 
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Dim shl As Shell
    Private taInfo As TextArea
End Sub
 
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.Show
End Sub
 
Sub btnClone_MouseClicked (EventData As MouseEvent)
    Log("clicked")
        shl.Initialize("Clone", "java.exe" , Array As String("-jar", "ShellTesting.jar"))
        shl.Run(-1)
End Sub
 
Sub clone_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
    If Success AND ExitCode = 0 Then  
        Log("Success")  
    Else  
        Log("Error: " & StdErr)
        Log("stdout: " & StdOut)
        taInfo.Text = "StdOut: " & StdOut
        taInfo.Text = "Error: " & StdErr
    End If
End Sub

I've also include the code as a file.. (just in case)..

Works great on Windows, Fails on my Mac Book Pro....

Thanks,

Gary Miyakawa
 

Attachments

  • clone.png
    clone.png
    40.5 KB · Views: 220
  • clone1.zip
    1.3 KB · Views: 168
Upvote 0
Top