B4J Tutorial B4LinuxInstall script to use B4X tools in linux

This is a Bash shell script that allows installing B4J and B4A in linux systems, along with their required dependencies. It is very functional. But for now only Ubuntu is fully supported.

The project has a repository in github. The only file you need is b4linuxinstall.sh. You can install it by opening a terminal and entering these commands:

B4X:
wget github.com/joseluis/B4LinuxInstall/raw/master/b4linuxinstall.sh
bash ./b4linuxinstall.sh
To install B4i and B4A you must download the installers and put them in the same directory before executing the script.
---

This is a work in progress. More linux distributions will also be supported eventually. There is a poll in this thread to know which are the most used in the community in order to prioritize them.

I must thank Zolive33 for his previous(1) work(2) from which B4LinuxInstall is built upon and tries to improve on the mission of bringing the software we love to our Linux computers.

UPDATE 2016: Since I'm no longer a user of B4X I'll probably wont be updating this tool anymore. Also it seems that since B4A version 5 there are some compatibility issues that difficults running it in linux.
 
Last edited:

barko

Member
Licensed User
Longtime User
I can run B4A v4.00 in Ubuntu Linux 14.04 LTS using Wine inside Oracle VM VirtualBox with B4A Bridge - using Wireless.

I was referring to new version of B4J with .net 4. I was try to install it with .net 4 and can't run it after install is over. I get some errors... B4A 4.0 is running ok, but I doubt about new version, as B4A will be using .net 4 too.
 

aeric

Expert
Licensed User
Longtime User
I was referring to new version of B4J with .net 4. I was try to install it with .net 4 and can't run it after install is over. I get some errors... B4A 4.0 is running ok, but I doubt about new version, as B4A will be using .net 4 too.
Unfortunately I am not a Beta tester for v5.0 so I am unable to test it. Maybe you can post the errors hopefully someone has a workaround.
 

zolive33

Active Member
Licensed User
Longtime User
Hello everyone,

I have good news: B4J v3.0 works fine on linux with PlayOnLinux.
Note : During Wine installation you must install dotnet40 (POL_Install_dotnet40).
 

Attachments

  • Capture du 2015-06-03 23:06:42.jpg
    Capture du 2015-06-03 23:06:42.jpg
    346 KB · Views: 369

barko

Member
Licensed User
Longtime User
Hello everyone,

I have good news: B4J v3.0 works fine on linux with PlayOnLinux.
Note : During Wine installation you must install dotnet40 (POL_Install_dotnet40).

Can you provide more informations about:

1) linux version
2) wine version
3) architecture of wine bottle (32/64)
4) other...

Thank you!
 

zolive33

Active Member
Licensed User
Longtime User
Can you provide more informations about:

1) linux version
2) wine version
3) architecture of wine bottle (32/64)
4) other...

Thank you!

1) Ubuntu 14.04
2) wine 1.7.38
3) 32bits
4) what else? ;-)
 

barko

Member
Licensed User
Longtime User
1) Ubuntu 14.04
2) wine 1.7.38
3) 32bits
4) what else? ;-)

I did try on ubuntu 15.04, no success at all, on lmde 2 betsy, same thing. Thank you for the infos.

EDIT: and on ubuntu 14.04 it works ok
 
Last edited:

johnaaronrose

Active Member
Licensed User
Longtime User
On Ubuntu 14.04, I ran the script OK & it runs Basic 4android v3.8 OK. I then decided to install B4A v5. It installed OK but it starts up v3.8 rather than v5 when I double click (in Nautilus) the B4A desktop configuration file in ~/workspace_b4. Erel tells me that the exe file has changed from Basic4android.exe to B4A.exe. On ~/workspace_b4/wine_b4/drive_c/Program Files/Anywhere Software/Basic4android folder, there is a Basic4android.exe file but no B4A.exe file. On ~/workspace_b4/wine_b4/drive_c/Program Files (x86)/Anywhere Software/Basic4android folder, there is a B4A.exe file. The B4A desktop configuration file in ~/workspace_b4 contains:
[Desktop Entry]
Name=B4A
Exec=env WINEPREFIX="/home/john/workspace_b4/wine_b4" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/john/workspace_b4/wine_b4/dosdevices/c:/users/Public/Start\\ Menu/Programs/Basic4android/Basic4android.lnk
Type=Application
StartupNotify=true
Path=/home/john/workspace_b4/wine_b4/dosdevices/c:/Program Files/Anywhere Software/Basic4android
Icon=B5FB_Basic4android.0

What should I do to start B4A v5? My first thought was to change the above Path statement to use 'Program Files (x86)', but I suspect there are hidden traps!
 
Last edited:

johnaaronrose

Active Member
Licensed User
Longtime User
I fixed running B4A v5 problem in previous post by uninstalling B4A & B4J and removing all traces of Basic4android followed by running the script again to install B4A & B4J. However, running B4A gives 'Needs .NET Framework V4.0.30319". This problem has been mentioned previously. Looking at https://appdb.winehq.org/objectManager.php?sClass=version&iId=17886, it says that install by 'winetricks dotnet40' is only for 32 bit Wine Prefix. As the script uses a 64 bit Wine Prefix, it doesn't work: confirmed by trying it. So I tried 'WINEARCH=win32 WINEPREFIX=/home/john/workspace_b4/wine_b4 winetricks dotnet40' which worked OK though it produced many messages. B4A now working.
PS I suggest that b4linuxinstall.sh be updated to include equivalent of above command.
 
Last edited:

johnaaronrose

Active Member
Licensed User
Longtime User
@joseluis App compiled OK with .apk created but no connection using B4A-Bridge on WiFi: I put in ip address given by B4A-Bridge into B4A but "Error on ping address", even though I can ping same ip address OK from my Ubuntu desktop. I've then tried connection by usb using adb: adb didn't find any devices. I don't think it's a frewall problem as I don't see anything relevant in /var/log/gufw.log or /var/log/ufw.log. It looked like that happened on your demo, but I did not understand what you then did (apart from saving your app) to solve the problem.

I can connect by Bluetooth from my desktop to my phone and send files, after standard procedure of requesting connection and entering desktop supplied PIN into phone. But B4A-Bridge says that it's waiting for Bluetooth connections!
 
Last edited:

FabioRome

Member
Licensed User
Longtime User
1) Ubuntu 14.04
2) wine 1.7.38
3) 32bits
4) what else? ;-)

@zolive33

Hi zoline. Thank you for your information.
I have in my pc debian 7.
I have few question:
1. Wine emule Vista or XP Windows ?
2. Which library ( Wine ) you add ?
3. All system emule 32 bit or 64 bit ?


Thank you in advance
Good day
Fabio
 

zolive33

Active Member
Licensed User
Longtime User

barko

Member
Licensed User
Longtime User
Thank you. with the old version I have no problems, with B4A v5.02... crash (Debian 7)

I did few tests and I have crash on ubuntu 15.04, linuxmint lmde 2 (betsy), but on ubuntu 14.04 no crash, even dotnet40 is installed ok; on other distros (mentioned before) i can't even install dotnet40 at all. Strange thing, something we missing here... I just wonder what is difference between those distros wine...
 

LWGShane

Well-Known Member
Licensed User
Longtime User
I love how the IDEs no longer look "out of place" when running via Wine.
 

gareththomasnz

Member
Licensed User
Longtime User
If you run B4A in wine on Ubuntu you can use android in virtualbox instead of the emulator

Its faster than a real phone - anyway i guess you all know

Ubuntu LTS 12.04

I have wine 1.6.1 &
wine-mono4.5.2


B4A 5.2 crashes on start

Do you guys know about crossover 14?

https://www.codeweavers.com/store/?utm_expid=4394146-28.fZuRhewXQhih58XB0T_qEA.0&utm_referrer=https://www.codeweavers.com/products/crossover-linux/

It keeps asking for dotnet 4.0.3019 which is installed

I am not a wine expert but I have used it for years & playonlinux

Right now running B4A unencumbered is more important than playing ARMA so I may do a purge & reinstall if I dont find a fix
 
Last edited:

barko

Member
Licensed User
Longtime User
Ubuntu LTS 12.04
Right now running B4A unencumbered is more important than playing ARMA so I may do a purge & reinstall if I dont find a fix

I'm not sure for ubuntu 12.04 LTS, but I can run/install the b4x on ubuntu 14.04 LTS (playonlinux wine 1.7.4x) w/o crash. Maybe you should try to upgrade the ubuntu.
 

Charles

Member
Licensed User
Longtime User
Installed B4A on my Dell Vostro 230 Core2 Duo from your video and install went well but when I tried installing it on my AMD FX6350 it fails to run.
Not sure why. The install was error free.
I am so fed up with how intrusive Windows is getting and now they are back installing, through updates, to windows 7 I'm trying to move all my necessary apps to ubuntu. It would be nice, I think, If Erel and the team would work with the wine team...
 

barko

Member
Licensed User
Longtime User
Installed B4A on my Dell Vostro 230 Core2 Duo from your video and install went well but when I tried installing it on my AMD FX6350 it fails to run.
Not sure why. The install was error free.

What OS do you have on your Dell? I did many tests and I can install B4J (i do not have B4A 5.0, but it has same structure i believe) and I can run it ok just on Ubuntu 14.04 LTS.
 
Top