GithubHelp home page GithubHelp logo

ev3dev-lang-java / installer Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 2.03 MB

A Bash script to install everything related with EV3Dev-lang-java

License: MIT License

Shell 96.57% Dockerfile 3.43%
ev3dev ev3dev-lang-java java ev3 bash-script robotics lejos

installer's Introduction

Installer

A Bash script to install everything related with EV3Dev-lang-java

Test result on master: Build Status

Motivation

EV3Dev is a fantastic Complete Linux environment to build software for robots with Java. But as any technology, the installation require some configuration to run in the right way.

This project tries to save time in this process.

The installer will install the following libraries by default:

  • OpenJDK 11 JRI for EV3, OpenJDK 11 JRE for the rest of the bricks

It is possible to install the following libraries if your project requires them.

Note Play with the help in order to discover the different options.

Getting Started

Starting point:

The starting point to use this installer, is a Brick running with EV3Dev and updated:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot

Running the installer

cd /home/robot
wget -N https://raw.githubusercontent.com/ev3dev-lang-java/installer/master/installer.sh
chmod +x installer.sh
sudo ./installer.sh help
sudo ./installer.sh

installer's People

Contributors

jabrena avatar jakubvanek avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

adesito sdebaerd

installer's Issues

Installer does not find jri-11-ev3

I did the recommended

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot

and then downloaded and starte the installer.sh to install java.

robot@ev3dev:~$ sudo ./installer.sh java

##############################
# EV3Dev-lang-java Installer #
##############################

Platform detected: ev3

No java detected
Installed Java version: '', installing anyway.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package jri-11-ev3

And not really a suprise:

robot@ev3dev:~$ sudo apt-get install jri-11-ev3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package jri-11-ev3

So it looks that jri-11-ev3 is not a valid apt package name.

Installer is not working

Using template project, I am trying to install OpenJDK in one Brick, but installer is not working:

From template project, I call the gradle task to install, installer:

> Task :getInstaller
mkdir /home/robot/installer
wget -N https://raw.githubusercontent.com/ev3dev-lang-java/installer/master/installer.sh -P /home/robot/installer

ev3dev#14|converted 'https://raw.githubusercontent.com/ev3dev-lang-java/installer/master/installer.sh' (ANSI_X3.4-1968) -> 'https://raw.githubusercontent.com/ev3dev-lang-java/installer/master/installer.sh' (UTF-8)
ev3dev#14|--2018-11-10 18:08:44--  https://raw.githubusercontent.com/ev3dev-lang-java/installer/master/installer.sh
ev3dev#14|Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.132.133
ev3dev#14|Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.132.133|:443... connected.
ev3dev#14|HTTP request sent, awaiting response... 200 OK
ev3dev#14|Length: 1417 (1.4K) [text/plain]
ev3dev#14|Saving to: '/home/robot/installer/installer.sh'
ev3dev#14|
ev3dev#14|     0K .                                                     100%  217K=0.006s
ev3dev#14|
ev3dev#14|Last-modified header missing -- time-stamps turned off.
ev3dev#14|2018-11-10 18:08:45 (217 KB/s) - '/home/robot/installer/installer.sh' saved [1417/1417]
ev3dev#14|

> Task :getInstaller
chmod +x /home/robot/installer/installer.sh
/home/robot/installer/installer.sh help

ev3dev#16|
ev3dev#16|##############################
ev3dev#16|# EV3Dev-lang-java Installer #
ev3dev#16|##############################
ev3dev#16|# Last update: 2018/11/10    #
ev3dev#16|##############################
ev3dev#16|
ev3dev#16|Init installer
ev3dev#16|/home/robot/installer/installer.sh: line 28: /home/robot/installer/module/vars.sh: No such file or directory
ev3dev#16|/home/robot/installer/installer.sh: line 28: /home/robot/installer/module/utilities.sh: No such file or directory
ev3dev#16|/home/robot/installer/installer.sh: line 20: createHeader: command not found
ev3dev#16|/home/robot/installer/installer.sh: line 22: /home/robot/installer/module/platform.sh: No such file or directory
ev3dev#16|/home/robot/installer/installer.sh: line 20: createHeader: command not found
ev3dev#16|/home/robot/installer/installer.sh: line 22: /home/robot/installer/module/help.sh: No such file or directory

Version of lejos-commons

Not sure if this is the right place to report this. There seems to be an inconsistency in the version of lejos-commons used between the different repositories. The script in this repository installs 0.7.2 on the brick, but e.g., the gradle wrapper provided in projects such as temple_project_gradle and examples generate jar files with 0.7.3 in their classpath (in the MANIFEST.MF). So when just following the examples on the web page, the code will not run on the brick, but instead give a ClassNotFoundException for the lejos classes.

P2P installer

Quoting from a readme:

It is nice to configure one brick but maybe you could discover that the installer could move the JDK one manual process to another brick and hte installer it is possible to replicate to another remote brick. Play with the help to discover the way.

Well, it might be possible to connect to a different brick via Bluetooth PAN. You could then compress the installed JDK, transfer it over SCP/SSH to the second brick and then unpack it there. IDK about how to fully automate it.

Platform UNKNOWN in Lego device

Hi

I've a lego Brick device with ev3dev (kernel 4.4.87-22 last one I guess).
When I run installer.sh and download platform.sh, platform appears as UNKNOWN because in the if sentence it search lego-v3-battery but in my device the file is named as legov3-battery.

Regards.

Convert to Debian package(s)

A small shell script putting this all together (maybe even without using apt-get update) should remain, but non-trivial stuff should be put into its own debian package.

installer wipes OpenJRE 11 and installs nothing

Did the manual install of the OpenJRE 11 on a fresh Linux installation (2018-11-13 Snapshot) according to the tutorial http://ev3dev-lang-java.github.io/docs/support/getting_started/brick.html:

wget obtained the file jri-ev3.tar.gz.
The command: sudo tar -zxvf jri-ev3.tar.gz -C /opt extracted the content to: /opt/jri
Then I renamed that: sudo mv /opt/jri/ /opt/jri-11
Then I did sudo update-alternatives --install /usr/bin/java java /opt/jri-11/bin/java 11
And finally java -Xshare:dump
Then JRE 11 was installed.

However, after installing the installer.sh and running sudo ./installer.sh java the following happened:

##############################
# EV3Dev-lang-java Installer #
##############################
# Last update: 2018/11/10    #
##############################

Init installer

#########################################
# PLATFORM SECTION                      #
#########################################

Platform detected: ev3


#########################################
# JAVA SECTION                          #
#########################################

/usr/bin/java
Found java executable in PATH
Installed Java version: '11.0.1', latest '11', installing anyway.
Detected a previous installation in path: /opt/jri-11
Deleting and reinstalling.

Downloading Java...
--2018-11-23 10:59:43--  https://ci.adoptopenjdk.net/view/ev3dev/job/openjdk11_build_ev3_linux/40/artifact/build/jri-ev3.tar.gz
Resolving ci.adoptopenjdk.net (ci.adoptopenjdk.net)... 78.47.239.97
Connecting to ci.adoptopenjdk.net (ci.adoptopenjdk.net)|78.47.239.97|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-11-23 10:59:45 ERROR 404: Not Found.

Java package acquired, installing...
tar: /home/robot/installer/jri-ev3.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
mv: cannot stat '/opt/jri': No such file or directory
update-alternatives: error: alternative path /opt/jri-11/bin/java doesn't exist
update-alternatives: warning: alternative /opt/jri-11/bin/java (part of link group java) doesn't exist; removing from list of alternatives
update-alternatives: warning: /etc/alternatives/java is dangling; it will be updated with best choice
update-alternatives: error: alternative /opt/jri-11/bin/java for java not registered; not setting
Output of 'java -version':
/home/robot/installer/module/java.sh: line 105: /opt/jri-11/bin/java: No such file or directory
Dumping class cache...
/home/robot/installer/module/java.sh: line 108: /opt/jri-11/bin/java: No such file or directory

and the JRE was gone..

Installer vs APT

Hmmm, installer might be replaced by a series of deb packages. That would provide automatic updates and it would be more robust.

Add support for OpenJDK 10 for EV3 Brick

It is necessary to upgrade the module java.sh to allow Install OpenJDK 10 for EV3:
https://github.com/ev3dev-lang-java/openjdk-ev3/releases
https://github.com/ev3dev-lang-java/openjdk-ev3/releases/tag/v0.4.5

currently the function wait Oracle JRE 8 stored on /home/robot:

function installJavaForEV3(){
    if [ -e "/home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" ]; then
        tar -zxvf "/home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" -C /opt
        update-alternatives --install /usr/bin/java java /opt/ejdk1.8.0/linux_arm_sflt/jre/bin/java 1
        java -version
    else
        echo "Sorry, the installer didn´t detect ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz"
        echo "on /home/robot"
        echo "try to copy the file again to the EV3 Brick."
        echo
        exit 1
    fi
}

but it is necessary to upgrade this function to download in an automated way latest JRI, Java Runtime Image compiled:
https://github.com/ev3dev-lang-java/openjdk-ev3/releases/download/v0.4.5/jri10-ev3.tar.gz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.