How to install SpiderBasic v3.20 on Linux?

Everything else that doesn't fall into one of the other categories.
AZJIO
Posts: 92
Joined: Wed Dec 14, 2022 1:13 pm

How to install SpiderBasic v3.20 on Linux?

Post by AZJIO »

1. I ran the install-cordova.sh script. He suggested that I install three packages npm, curl, openjdk-17-jre. I have installed all these packages. And then he installed cordova.
2. When I compile I get this

Code: Select all

Using cordova-fetch for cordova-android@14.0.1
Adding android project...
Creating Cordova project for the Android platform:
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@14.0.1
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
Installing "cordova-plugin-battery-status" for android
Adding cordova-plugin-battery-status to package.json
Installing "cordova-plugin-vibration" for android
Adding cordova-plugin-vibration to package.json
Installing "cordova-plugin-brightness" for android
Adding cordova-plugin-brightness to package.json
Installing "cordova-plugin-nativeaudio" for android
Adding cordova-plugin-nativeaudio to package.json
Checking Java JDK and Android SDK versions
ANDROID_HOME=/home/user/Apps/spiderbasic_demo/android/android/sdk (recommended setting)
ANDROID_SDK_ROOT=undefined (DEPRECATED)
Failed to run "javac -version", make sure that you have a JDK version 8 installed.
You can get it from the following location:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Linux Mint 22.3
Fred
Site Admin
Posts: 1870
Joined: Mon Feb 24, 2014 10:51 am

Re: How to install SpiderBasic v3.20 on Linux?

Post by Fred »

how did you install openjdk ? May be you will need to set the JAVA_HOME env var in your term before launching the compilation
AZJIO
Posts: 92
Joined: Wed Dec 14, 2022 1:13 pm

Re: How to install SpiderBasic v3.20 on Linux?

Post by AZJIO »

Code: Select all

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
echo $JAVA_HOME
screenshot jdk-8
screenshot jdk-17

But nothing has changed.


zulu17.64.17-ca-jdk17.0.18-linux_x64.tar.gz
zulu8.92.0.21-ca-jdk8.0.482-linux_x64.tar.gz

Code: Select all

export JAVA_HOME=/home/user/Apps/jdk8.0.482-linux_x64
echo $JAVA_HOME
But nothing has changed.

How do I use --verbose?

https://www.oracle.com/technetwork/java ... 33151.html
In compliance with U.S. and applicable Export laws we are unable to process your request to https://signon.oracle.com/signin. Please contact RPLS-Ops_ww@oracle.com if you believe you are receiving this notice in error.
AZJIO
Posts: 92
Joined: Wed Dec 14, 2022 1:13 pm

Re: How to install SpiderBasic v3.20 on Linux?

Post by AZJIO »

SPIDERBASIC_HOME is used in the script, but it is not defined. I added it manually, but it should work during installation.
AZJIO
Posts: 92
Joined: Wed Dec 14, 2022 1:13 pm

Re: How to install SpiderBasic v3.20 on Linux?

Post by AZJIO »

I was advised to do the following, which I did.

I unpacked "/opt/java" here, I got the path "/opt/java/jdk1.8.0/bin"

Adding an alternative with the ID 100

Code: Select all

sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.8*/bin/java 100
Choosing an alternative by choosing an identifier

Code: Select all

sudo update-alternatives --config java
Unpack the downloaded from https://services.gradle.org/distributio ... e-8.13-bin .zip to /opt/java/gradle-8.13 folder

Adding an alternative under the identifier 100

Code: Select all

sudo update-alternatives --install /usr/bin/gradle gradle /opt/gradle-8.13/bin/gradle 100
Choosing an alternative by choosing an identifier. It's in one copy, so you don't have to choose.

Code: Select all

sudo update-alternatives --config gradle
Now I get another error.

Code: Select all

Компиляция...
Creating a new cordova project.
Создание приложения...
Using cordova-fetch for cordova-android@14.0.1
Adding android project...
Creating Cordova project for the Android platform:
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@14.0.1
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
Installing "cordova-plugin-battery-status" for android
Adding cordova-plugin-battery-status to package.json
Installing "cordova-plugin-vibration" for android
Adding cordova-plugin-vibration to package.json
Installing "cordova-plugin-brightness" for android
Adding cordova-plugin-brightness to package.json
Installing "cordova-plugin-nativeaudio" for android
Adding cordova-plugin-nativeaudio to package.json
Checking Java JDK and Android SDK versions
ANDROID_HOME=/home/user/Apps/spiderbasic_demo/android/android/sdk (recommended setting)
ANDROID_SDK_ROOT=undefined (DEPRECATED)
Using Android SDK: /home/user/Apps/spiderbasic_demo/android/android/sdk
> Task :wrapper
[Incubating] Problems report is available at: file:///tmp/spiderbasic-1771449863/app/platforms/android/tools/build/reports/problems/problems-report.html
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 941ms
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
[Incubating] Problems report is available at: file:///tmp/spiderbasic-1771449863/app/platforms/android/build/reports/problems/problems-report.html
FAILURE: Build failed with an exception.
* Where:
Script '/tmp/spiderbasic-1771449863/app/platforms/android/CordovaLib/cordova.gradle' line: 73
* What went wrong:
A problem occurred evaluating script.
> No installed build tools found. Please install the Android build tools version 35.0.0.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 429ms
Command failed with exit code 1: /tmp/spiderbasic-1771449863/app/platforms/android/tools/gradlew cdvBuildRelease
I also tried JDK17+gradle-9.3.1, but SB required gradle-8.13 and I returned it back.
AZJIO
Posts: 92
Joined: Wed Dec 14, 2022 1:13 pm

Re: How to install SpiderBasic v3.20 on Linux?

Post by AZJIO »

1. Can you write a Readme that contains commands for installing packages?
2. Can you write how to check the installation of packages, for example gradle -v, java -version and javac -version and show what the output of the results should be?
3. Can you write that installing gradle should give a new gradle folder in the /spiderbasic_demo/android folder?
4. Can you specify that the launch install-cordova.sh they must be executed after installing all packages, otherwise the gradle folder will not be copied to the /spiderbasic_demo/android folder.
5. Can you specify how to run the script install-cordova.sh ? I do this:

Code: Select all

cd ~/Apps/spiderbasic_demo
./install-cordova.sh
Not everyone is an experienced user. I have always used Windows and it is difficult for me to study another system, since I do not understand what it does, but it is easy for me to understand how to check the appearance of files in a folder after the script is running.
6. Can you add JAVA package installation commands (sudo update-alternatives --install /usr/bin/java java/opt/java/jdk1.8*/bin/java 100).
7. Can you add JAVA package switching commands (sudo update-alternatives --config java) if the user has installed several packages?

Can you write in the Readme what the ANDROID_SDK_ROOT, ANDROID_HOME, and JAVA_HOME variables should be equal to? I understand that SPIDERBASIC_HOME is set by the IDE itself. But how are the other variables set? The export JAVA_HOME= command... valid until reboot. Should it matter after restarting the computer? And how do I add it permanently? In the Compilation Settings, I have to specify the path to the JDK, what should I specify there?
AZJIO
Posts: 92
Joined: Wed Dec 14, 2022 1:13 pm

Re: How to install SpiderBasic v3.20 on Linux?

Post by AZJIO »

I managed to build an APK package!
1. Deleted all versions and alternatives via package manager and by deleting the created symlinks:

Code: Select all

sudo update-alternatives --remove java /opt/java/jdk1.8.0
2. Installed the package openjdk-21-jre, openjdk-21-jdk, these packages added the interconnected packages openjdk-21-jre-headless and openjdk-21-jdk-headless
3. In the compiler settings, I specified the path /usr/lib/jvm/java-1.21.0-openjdk-amd64 in the field, but this is actually a symlink to "java-21-openjdk-amd64" in the same folder.
4. Download gradle8, I unpacked it to the /opt/gradle-8.13 folder and added

Code: Select all

sudo update-alternatives --install /usr/bin/gradle gradle /opt/gradle-8.13/bin/gradle 100
then checked gradle with

Code: Select all

sudo update-alternatives --config gradle
then checked java with

Code: Select all

sudo update-alternatives --config java

Code: Select all

javac -version
5. Add the JAVA_HOME variable

Code: Select all

export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
6. Run the script install-cordova.sh
dmontaine
Posts: 9
Joined: Mon Nov 13, 2017 5:19 pm

Re: How to install SpiderBasic v3.20 on Linux?

Post by dmontaine »

You can try this script (it is on the Purebasic Forum). It will install Pure or Spider Basic or Both if the downloads are available.

Code: Select all

#!/bin/bash
# this assumes the pure and spider basic tgz
# downloads and this script are in the Downloads directory 
# this script is for Debian 13 and Purebasic 6.30 on Debian Trixie
# packages are installed in related groups so that those that are not needed
# can be commented out.
#
# 9 Sep 2025 	
# - specialized script for Debian Trixie installation
# - updated libraries to those available in Trixie
# - added libraries for new features in 6.30
# - added chain to cordova-installer.sh script
# - added mime info for SpiderBasic
# - added installation libraries required for cordova
# - made cordova installation option
#                
# 3 Oct 2023    
# - added checks for existing installs
# - handle lowercase downloads directory name
# - and missing install files
# - added additional messages
# - changed to apt-get and routed output to /dev/null
#
# 15 Oct 2023	
# - removed routing of apt-get output to /dev/null
# - disabled ability to run as root user
# - changed some echo messages
#
#----------------------------------------------------------------------------------------
# Disallow running script as root user
#----------------------------------------------------------------------------------------
#
if [[ $EUID -eq 0 ]]; then
  echo "This script must NOT be run as root" 1>&2
  exit 1
fi
#
#----------------------------------------------------------------------------------------
# PRE-INSTALLATION TESTS
#----------------------------------------------------------------------------------------
clear
echo "PureBasic and/or SpiderBasic Install Script for Debian Trixie"
echo "--------------------------------------------------------------------"
echo
echo "This install script is only for Pure Basic 6.30 and/or Spider Basic 3.10 or later"
echo "on Debian Trixie (13)"
echo
echo
read -p "Continue? (y/N) " yn
case $yn in
    [yY] ) echo;;
    [nN] ) exit;;
    * ) exit ;;
esac
clear
#
echo "Working ..."
#
cd ~/Downloads
#
if test -d ~/purebasic; then
	echo "Pure Basic is already installed"
fi
if ! test -f PureBasic*.tgz; then
	echo "No Pure Basic install file available"
fi
if test -d ~/spiderbasic; then
	echo "Spider Basic is already installed"
fi
if ! test -f SpiderBasic*.tgz; then
	echo "No Spider Basic install file available"
fi
if test -d ~/purebasic && test -d ~/spiderbasic; then
	echo "Pure Basic and Spider Basic are already installed"
	echo "Nothing to do!"
	exit
fi

if ! test -f PureBasic*.tgz && ! test -f SpiderBasic*.tgz; then
    echo "Pure Basic and Spider Basic install files missing"
    echo "Nothing to do!"
    exit
fi
#
#----------------------------------------------------------------------------------------
# MAKE SURE MIME AND APPLICATIONS DIRECTORIES EXIST
#----------------------------------------------------------------------------------------
#
if [ ! -d ~/.local/share/mime/packages ]; then mkdir -p ~/.local/share/mime/packages; fi
if [ ! -d ~/.local/share/applications ]; then mkdir -p ~/.local/share/applications; fi
#
#----------------------------------------------------------------------------------------
# MAKE SURE desktop-file-utils ARE INSTALLED
#----------------------------------------------------------------------------------------
#
sudo apt-get -y install desktop-file-utils 
#
#----------------------------------------------------------------------------------------
# PURE BASIC INSTALL
#----------------------------------------------------------------------------------------
#
if test -f PureBasic*.tgz && ! test -d ~/purebasic; then	
	tar -xf PureBasic*.tgz
	mv purebasic ..
	cd ../purebasic
	#
	#----------------------------------------------------------------------------------------
	# START OF LIBRARIES and PACKAGES INSTALLATION
	#----------------------------------------------------------------------------------------
	#
	sudo apt-get -y install build-essential gcc g++
	sudo apt-get -y install libxxf86vm-dev libxine2-dev unixodbc-dev libsdl1.2-dev libsdl2-dev libssl-dev 
	sudo apt-get -y install libgtk2.0-dev libgtk-3-dev
	sudo apt-get -y install libwebkit2gtk-4.1-dev
	#	#----------------------------------------------------------------------------------------
	# VLC development libraries
	#
	sudo apt-get -y install libvlc-dev
	#	#----------------------------------------------------------------------------------------
	# Mesa development libraries
	#
	sudo apt-get -y install libgl1-mesa-dev libgl1 libglx-mesa0
	#	#----------------------------------------------------------------------------------------
	# qt5 development libraries
	#
	sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qttools5-dev qtmultimedia5-dev qtdeclarative5-dev libqt5svg5-dev libqt5webengine5 libqt5multimedia5-plugins	qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
	#	#----------------------------------------------------------------------------------------
	# PureBasic IDE support package
	#
	sudo apt-get -y install libcanberra-gtk3-module
	#
#----------------------------------------------------------------------------------------	
	
	# HID support packages
	sudo apt-get -y install libusb-1.0-0-dev libudev-dev
	#	#----------------------------------------------------------------------------------------
	# END OF LIBRARIES and PACKAGES INSTALLATION	#----------------------------------------------------------------------------------------	#----------------------------------------------------------------------------------------
	#
	# MIME INFO FOR PURE BASIC
	#
	# change to dir for purebasic.xml
	cd ~/.local/share/mime/packages
	# purebasic.xml create
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > purebasic.xml
	echo "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>" >> purebasic.xml
	echo "   <mime-type type=\"text/purebasic\">" >> purebasic.xml
	echo "      <comment>PureBasic source code</comment>" >> purebasic.xml
	echo "      <glob pattern=\"*.pb\"/>" >> purebasic.xml
	echo "      <glob pattern=\"*.pbi\"/>" >> purebasic.xml
	echo "      <glob pattern=\"*.pbf\"/>" >> purebasic.xml
	echo "   </mime-type>" >> purebasic.xml
	echo "</mime-info>" >> purebasic.xml
	update-mime-database ~/.local/share/mime
	#----------------------------------------------------------------------------------------
	# Create Pure Basic Desktop File
	#----------------------------------------------------------------------------------------
	#
	# change to dir for PureBasic.desktop
	cd ~/.local/share/applications
	#
	# Create PureBasic.desktop file
	echo "[Desktop Entry]" > PureBasic.desktop
	echo "Comment=PureBasic IDE" >> PureBasic.desktop
	echo "Terminal=false" >> PureBasic.desktop
	echo "Name=PureBasic" >> PureBasic.desktop
	echo "Type=Application" >> PureBasic.desktop
	echo "MimeType=text/purebasic" >> PureBasic.desktop
	echo "Categories=Development;" >> PureBasic.desktop
	echo "StartupNotify=true" >> PureBasic.desktop
	echo "Exec=${HOME}/purebasic/compilers/purebasic" >> PureBasic.desktop
	echo "Icon=${HOME}/purebasic/logo.png" >> PureBasic.desktop
	update-desktop-database  ~/.local/share/applications
	if test -d ~/purebasic; then
		echo "PureBasic installed"
	fi
fi
#
cd ~/Downloads
#
#----------------------------------------------------------------------------------------
# SPIDER BASIC INSTALL SECTION
#----------------------------------------------------------------------------------------
#
if test -f SpiderBasic*.tgz && ! test -d ~/spiderbasic; then	
	#
	tar -xf SpiderBasic*.tgz
	mv spiderbasic ..
	#
	#----------------------------------------------------------------------------------------
	# MIME INFO FOR SPIDER BASIC
	#----------------------------------------------------------------------------------------
	# change to dir for spiderbasic.xml
	cd ~/.local/share/mime/packages
	# spiderbasic.xml create
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > spiderbasic.xml
	echo "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>" >> spiderbasic.xml
	echo "   <mime-type type=\"text/spiderbasic\">" >> spiderbasic.xml
	echo "      <comment>SpiderBasic source code</comment>" >> spiderbasic.xml
	echo "      <glob pattern=\"*.sb\"/>" >> spiderbasic.xml
	echo "      <glob pattern=\"*.sbi\"/>" >> spiderbasic.xml
	echo "      <glob pattern=\"*.sbp\"/>" >> spiderbasic.xml
	echo "      <glob pattern=\"*.sbf\"/>" >> spiderbasic.xml
	echo "   </mime-type>" >> spiderbasic.xml
	echo "</mime-info>" >> spiderbasic.xml
	update-mime-database ~/.local/share/mime
	# change to dir for spiderbasic.xml
	cd ~/.local/share/mime/packages
	#----------------------------------------------------------------------------------------
	# Create Spider Basic Desktop File
	#----------------------------------------------------------------------------------------
	cd ~/.local/share/applications
	# Create SpiderBasic.desktop file
	echo "[Desktop Entry]" > SpiderBasic.desktop
	echo "Comment=SpiderBasic IDE" >> SpiderBasic.desktop
	echo "Terminal=false" >> SpiderBasic.desktop
	echo "Name=SpiderBasic" >> SpiderBasic.desktop
	echo "Type=Application" >> SpiderBasic.desktop
	echo "Categories=Development;" >> SpiderBasic.desktop
	echo "StartupNotify=true" >> SpiderBasic.desktop
	echo "Exec=${HOME}/spiderbasic/compilers/spiderbasic" >> SpiderBasic.desktop
	echo "Icon=${HOME}/spiderbasic/logo.png" >> SpiderBasic.desktop
	update-desktop-database  ~/.local/share/applications
	
	if test -d ~/spiderbasic; then
		echo "SpiderBasic installed"
	fi
fi

cd ~/Downloads
#
#----------------------------------------------------------------------------------------
# end of script message
#----------------------------------------------------------------------------------------
#
if ! test -d ~/purebasic; then
	echo "Pure Basic not installed"
fi
if ! test -d ~/spiderbasic; then
	echo "Spider Basic not installed"
else
	echo
	echo "Do you want to run the install_cordova script"
	echo "To enable Android Development using Spider Basic"
	echo
	echo
	read -p "Yes or No? (y/N) " yn
	case $yn in
	    [yY] ) clear 
		   sudo apt-get -y install nodejs npm curl openjdk-21-jre
		   cd ../spiderbasic
		   exec ./install-cordova.sh;;
	    [nN] ) exit;;
	    * ) exit ;;
	esac
fi
#
#----------------------------------------------------------------------------------------
echo "Pure and Spider Basic install script completed"
#----------------------------------------------------------------------------------------

Post Reply