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:

doogal

Member
Licensed User
Longtime User
@joseluis, Thank you so much for this script. I am currently working with version 3.82. I have a new question, is this script compatible with the new 4.0 and further updates?
Thank you,
Doug
 

joseluis

Active Member
Licensed User
Longtime User
Yes. It should work well with further updates too, as long as the dependencies doesn't change, but that would be unusual.
 

LWGShane

Well-Known Member
Licensed User
Longtime User
Please update this for B4i support! I can finally get rid of Windows yet still use B4x products.

Ubuntu + Parallels = Awesomeness.

For reference, I'm getting this error when launching B4i (actually displays as B4A):

Details: Failed to change to directory '/home/shane/workspace_b4/wine_b4/dosdevices/c:/Program Files/Anywhere Software/Basic4android' (No such file or directory)
 
Last edited:

joseluis

Active Member
Licensed User
Longtime User
I'm working in an updated version of the script to automatically install B4I. But until then you can install it manually with this command:
B4X:
WINEARCH=win32 WINEPREFIX=/home/${USER}/workspace_b4/wine_b4/ wine b4i-beta_18.exe
Note that you have to download the installer first, and refer to it in the command.

That error you have there is because you gave the script the download link for B4I, but the script specifically expects B4A and treats it like that ;)
 

joseluis

Active Member
Licensed User
Longtime User
Script updated to version 20150117
  • New B4i Installation
  • removed the optional URL parameter. To install B4i and the full version of B4A you must download the installers and put them in the same directory before executing the script.
  • Updated Android SDK version
  • minor updates and fixes
 

barko

Member
Licensed User
Longtime User
Thanks for this script! I love it! :) Just for info: under ubuntu 64bit I need to use wine 1.7, because 1.6 it can't start/install dotnet properly.
 

JimT

New Member
(Compiler) Cannot find: ****\workspace_b4\android-sdk-linux\platform-tools\aapt.exe

Install script vers: 20150127, Ubuntu 14.04, fresh download of all tools, including b4a-trial.exe

[I am a B4A virgin, but a programmer, and fairly experienced linux user. Ive tried all the logical steps & tests]. Ive set the paths as per the instructional video.

I note the compiler is looking for a windows exe in an android-sdk-linux folder? (NB: Im using b4a-trail.exe)

After googleing, I found a fairly old reference to a similar problem, but that was in native windows, not the linux/wine mashup. The solution back then was to move aapt.exe and its lib folder from platforms/android-** to android-sdk-win/platform-tools. I did try the linux equivelant of that, to no avail.

Hey, I even plonked a windows aapt.exe in the (linux!) android-sdk-linux\platform-tools folder..
I diddnt really expect that to work, but figured it might shed more light; It produced a new error:
AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'theme' with value '@android:style/Theme.Holo

Frankly, I suspect b4a-trail.exe has missed out on an update that the full-version received.
But maybe Im missing the obvious.. Thanks, in advance.
 

barko

Member
Licensed User
Longtime User
All informations are already in this thread. So, first go to git repository and download file sdk-B4A.tar.gz (just click on view raw and dl will start), extract it into "workspace_b4\android-sdk-linux\" and you'r good to go. :)
 

barko

Member
Licensed User
Longtime User
B4J: here is mini howto to associate .fxml with native linux javafx scene builder.

1) download and extract association.zip
2) from terminal run this line to put association.reg to registry (from map where you extracted .reg file):

WINEARCH=win32 WINEPREFIX=/home/${USER}/workspace_b4/wine_b4/ regedit association.reg

Now you can run javafx scene builder from within B4J.

Enjoy!
 

Attachments

  • association.zip
    254 bytes · Views: 350

JimT

New Member
All informations are already in this thread. So, first go to git repository and download file sdk-B4A.tar.gz (just click on view raw and dl will start), extract it into "workspace_b4\android-sdk-linux\" and you'r good to go. :)

Thank you @barko To my shame, I missed it. Fixed now.
And the AndroidManifest.xml:18: error was because I had Toos > PathConfiguration > android.jar set to an early platform.
After upping the platform to android-21 I was indeed good to go.

Cheers.
 

aeric

Expert
Licensed User
Longtime User
First I follow the steps to install AndroidSDK that I found from https://help.ubuntu.com/community/AndroidSDK and then run the script provided in this thread.
1. Download Android SDK from http://developer.android.com/sdk and then run the following command:
$ tar -xvzf android-sdk_r23.0.2-linux.tgz && mv android-sdk-linux ~/
2. Run the following command to install Java:
$ sudo apt-get install openjdk-6-jre openjdk-6-jdk icedtea6-plugin
3. Run the following command to install Android SDK Linux platform tools
$ cd ~/android-sdk-linux/tools
$ ./android
4. Run the command in the first post
wget github.com/joseluis/B4LinuxInstall/raw/master/b4linuxinstall.sh
bash ./b4linuxinstall.sh
5. Finish the installation. B4A show 'ugly' Splash and About form. After restart B4A, it will show normal.

Note: I am running from Ubuntu 10.04.2 LTS 32bit inside Oracle VM VirtualBox version 4.3.26 with Guest Additions. The Android SDK I am using is android-sdk_r23.0.2-linux.tgz.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
I'm missing something from my install. Not sure what, but b4j runs ok, b4a just spins then quits.

Is there anything I can check to get this going?
-----
Ok, doesn't look like b4a installed correctly.
====

Great, downloaded the trial version, and re-ran the installer. works great.
 
Last edited:

corwin42

Expert
Licensed User
Longtime User
Great work.

I just installed B4J and B4A in a VM with Chromixium which is something like ChromeOS and Ubuntu together. The script worked well.

If I have seen it correct, .NET 2.0 is used. Unfortunately the new IDE will need .NET 4.0. Does anyone know if Wine works with 4.0, too?

My goal is to install Chromixium OS on my Asus eeePC netbook because the Windows 7 starter edition is crappy on this device. The possibility to run B4A on this with Chromixium would be awesome.
 

aeric

Expert
Licensed User
Longtime User
ATM B4X is not possible to run under wine for linux. Maybe in near future. At least for me.
I can run B4A v4.00 in Ubuntu Linux 14.04 LTS using Wine inside Oracle VM VirtualBox with B4A Bridge - using Wireless.
B4A-4.00.jpg
 

aeric

Expert
Licensed User
Longtime User
Unfortunately the new IDE will need .NET 4.0. Does anyone know if Wine works with 4.0, too?
According to WineHQ website, .NET Framework 4.0 is supported in Wine
https://appdb.winehq.org/objectManager.php?sClass=version&iId=17886

Name.NET Framework
Version4.0
LicenseFree to use
URLhttp://msdn.microsoft.com/netf...
Votes6
RatingGold
Wine Version1.6.2
Free DownloadMicrosoft .NET Framework 4 (Standalone Installer) (48.1 MB)Direct download
Free DownloadMicrosoft .NET Framework 4 (Web Installer) (868 KB)
Free DownloadMicrosoft .NET Framework 4 (Standalone Installer)

View/Submit Screenshot

Maintainers of this version:
 
Top