Skip to content

Commit

Permalink
commit for final release 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
trestoa committed Sep 8, 2013
1 parent 9d1d3a0 commit 03eb11c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 115 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,35 @@ LinkJVM is a Java Environment of the [KIPR Link](http://www.kipr.org/products/li
##Installing LinkJVM
Basically there are two different ways to install LinkJVM:

###1. Installing a Release
The easiest way is to install a pre-built LinkJVM. You just have to download the latest release, extract it, put it on the Link and run the install.sh script.
In this way you have always the latest stable version on you controller.
If you just want to use LinkJVM it is strongly remommended to install release.
###1. Install

It is very easy to install LinkJVM from a release:

#### 1. Download it and extract it on a flash drive
[Download] the latest release from the server and extract it on any external flash drive.
If you want to use an older relase download it from the [Releaseserver of LinkJVM](http://files.mklein.co.at/LinkJVM/release/).
There a two ways the get LinkJVM.

##### Download a pre-build LinkJVM from the fileserver
Using a pre-built version of LinkJVM is the fastest way to get Java on the KIPR Link.

[LinkJVM Fileserver](http://files.mklein.co.at/LinkJVM/release)

##### Download a Github Release
The installation process of the source distribution will take slightly long.

[LinkJVM Github Releases](https://github.com/kleiinnn/LinkJVM/releases)

#### 2. Insert the flash drive into your Link

#### 3. Compile and run the install.c programm.
Click on "file manager" browse to the location where LinKJVM was saved on the flash drive.
Go into `install` directory.
Click on linkjvm-install.c and on compile.
Click on `linkjvm-install.c` and on compile.
Run linkjvm-install.

#### 4. Code Java and have Fun!
linkjvm-install is not needed anymore, you can delete it.


###2. Building it from the Repository
If you always want the lastest developent state you can build LinkJVM directly from the Repository.
Please refer to install/INSTALL.md for build instructions.

##Robot Library
LinkJVM provides a huge Libray for controlling the robot(reading analog and digital sensor values, controlling motors and servos, ...). This library is acually only a wrapper library for the in native c written [libkovan](https://github.com/kipr/libkovan).

Expand All @@ -62,7 +64,7 @@ LinkJVM integrates an open source library for controlling the [Parrot AR Drone](
This file is part of LinkJVM.

Java Framework for the KIPR Link
Copyright (C) 2013 Markus Klein<m@mklein.co.at>
Copyright (C) 2013 Markus Klein m@mklein.co.at

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
41 changes: 0 additions & 41 deletions install/INSTALL.markdown

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@

int main(){
printf("Welcome to LinkJVM!");
system("install.sh");
system("sh install.sh");
}
86 changes: 25 additions & 61 deletions install/install-release/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,110 +20,74 @@
#

INSTALLATION_DIR=/usr/local/LinkJVM
ECJ_JAR=ecj-3.7.jar

function init(){
echo "initializing installation..."
function install_linkjvm(){
rm -r /usr/bin/java /usr/bin/jamvm /usr/share/jamvm /usr/bin/javac /usr/bin/ecj $INSTALLATION_DIR
mkdir $INSTALLATION_DIR $INSTALLATION_DIR/include $INSTALLATION_DIR/lib $INSTALLATION_DIR/share $INSTALLATION_DIR/bin
mkdir -p $INSTALLATION_DIR
if [[ $? != 0 ]]; then
return 1
fi
cd ../java-environment
if [[ $? != 0 ]]; then
return 1
fi
return 0
}

function install_javac(){
echo "installing java compiler..."
mkdir $INSTALLATION_DIR/lib/javac
if [[ $? != 0 ]]; then
return 1
fi
cp javac/$ECJ_JAR $INSTALLATION_DIR/lib/javac/
cd ..
if [[ $? != 0 ]]; then
return 1
fi
cd javac; gcc -o javac javac.c
cp -r * $INSTALLATION_DIR
if [[ $? != 0 ]]; then
return 1
fi
cd ..
ln -s $INSTALLATION_DIR/bin/javac /usr/bin/javac
if [[ $? != 0 ]]; then
return 1
fi
cp javac/javac $INSTALLATION_DIR/bin/
ln -s $INSTALLATION_DIR/bin/javac /usr/bin/ecj
if [[ $? != 0 ]]; then
return 1
fi
ln -s $INSTALLATION_DIR/bin/javac /usr/bin/javac
ln -s $INSTALLATION_DIR/bin/jamvm /usr/bin/java
if [[ $? != 0 ]]; then
return 1
fi
ln -s $INSTALLATION_DIR/bin/javac /usr/bin/ecj
ln -s $INSTALLATION_DIR/bin/jamvm /usr/bin/jamvm
if [[ $? != 0 ]]; then
return 1
fi
return 0
}

function install_classpath(){
echo "installing gnu classpath..."
cp -r classpath/* $INSTALLATION_DIR/
if [[ $? != 0 ]]; then
more /etc/profile | grep "export BOOTCLASSPATH=/usr/local/LinkJVM/share/jamvm/classes.zip:/usr/local/LinkJVM/share/classpath/glibj.zip:/usr/local/LinkJVM/lib/LinkJVM.jar"
if [[ $? == 1 ]]; then
echo "export BOOTCLASSPATH=/usr/local/LinkJVM/share/jamvm/classes.zip:/usr/local/LinkJVM/share/classpath/glibj.zip:/usr/local/LinkJVM/lib/LinkJVM.jar" >> /etc/profile
elif [[ $? < 0 ]]; then
return 1
fi
return 0
}

function install_jvm(){
echo "installing jvm..."
cp -r jamvm/* $INSTALLATION_DIR/
if [[ $? != 0 ]]; then
more /etc/profile | grep "export LD_LIBRARY_PATH=/usr/local/LinkJVM/lib/classpath"
if [[ $? == 1 ]]; then
echo "export LD_LIBRARY_PATH=/usr/local/LinkJVM/lib/classpath" >> /etc/profile
elif [[ $? < 0 ]]; then
return 1
fi
ln -s $INSTALLATION_DIR/bin/jamvm /usr/bin/java
if [[ $? != 0 ]]; then
more /etc/profile | grep "export CLASSPATH=/usr/local/LinkJVM/share/jamvm/classes.zip:/usr/local/LinkJVM/share/classpath/glibj.zip:/usr/local/LinkJVM/lib/LinkJVM.jar:."
if [[ $? == 1 ]]; then
echo "export CLASSPATH=/usr/local/LinkJVM/share/jamvm/classes.zip:/usr/local/LinkJVM/share/classpath/glibj.zip:/usr/local/LinkJVM/lib/LinkJVM.jar:." >> /etc/profile
elif [[ $? < 0 ]]; then
return 1
fi
ln -s $INSTALLATION_DIR/bin/jamvm /usr/bin/jamvm
export BOOTCLASSPATH=/usr/local/LinkJVM/share/jamvm/classes.zip:/usr/local/LinkJVM/share/classpath/glibj.zip:/usr/local/LinkJVM/lib/LinkJVM.jar
if [[ $? != 0 ]]; then
return 1
fi
last_row=`sed -e '/^[<blank><tab>]*$/d' /etc/profile | sed -n -e '$p'`
export LD_LIBRARY_PATH=/usr/local/LinkJVM/lib/classpath
if [[ $? != 0 ]]; then
return 1
fi
if [[ $last_row = 'sh /usr/local/LinkJVM/etc/environment-vars.sh' ]]; then
'sh /usr/local/LinkJVM/etc/environment-vars.sh' >> /etc/profile
fi
export CLASSPATH=/usr/local/LinkJVM/share/jamvm/classes.zip:/usr/local/LinkJVM/share/classpath/glibj.zip:/usr/local/LinkJVM/lib/LinkJVM.jar:.
if [[ $? != 0 ]]; then
return 1
fi
return 0
}

echo "[INSTALL] Installing LinkJVM..."
init
if [[ $? != 0 ]]; then
echo "[ERROR] init returned a non zero status code"
exit
fi
install_javac
if [[ $? != 0 ]]; then
echo "[ERROR] install_javac returned a non zero status code"
exit
fi
install_classpath
if [[ $? != 0 ]]; then
echo "[ERROR] install_classpath returned a non zero status code"
exit
fi
install_jvm
install_linkjvm
if [[ $? != 0 ]]; then
echo "[ERROR] install_jvm returned a non zero status code"
echo "[ERROR] install_linkjvm returned a non zero status code"
exit
fi
echo "[INSTALL] LinkJVM java environment installed!"

0 comments on commit 03eb11c

Please sign in to comment.