# Getting Started
Setup Smile Dev Environment
- Install Java
- Install Smile
- Install Eclipse
- Install Intellij
- Create new Smile Project
- Import project into eclipse
- Import project into intelliJ
- Install and Setup Mongo
# Install Java
ENSURE JAVA 1.8 IS SET
To use the Smile platform, you need JDK 8. Be sure to have the java and
javac commands in the current path (you can check this by typing java -version and javac -version at the shell prompt).
> java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
If Java 8 is not installed, follow thelink to install and SET to Classpath. https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
Create installs & softwares folder under user home.
> cd
~> mkdir installs
~> mkdir softwares
Video reference:
# Install Smile
Download
install-smile.shfrom bitbucket:
https://bitbucket.org/metastay/repo/downloads/Copy the downloaded installer
install-smile.shto ~/installsGrant execute permission to this shell script:
~> cd installs
installs> chmod +x install-smile.sh
Open
install-smile.shfile and set eclipse_installed_dir to ./eclipse/jee-oxygenIn
install-smile.shfile also set eclipse_dropins_plugins_dir to $eclipse_installed_dir"/Eclipse.app/Contents/Eclipse/dropins"
NOTE
x.x.x -> Download the latest smile version
installs> ./install-smile.sh x.x.x
- Set smile in the PATH
For Ubuntu :
gedit .bashrc
For Mac : (* sublime should be installed)
subl .bash_profile
- Append the following 2 lines to .bashrc/.bash_profile
For Ubuntu :
export SMILE_HOME="$HOME/installs/smile"
export PATH=“$SMILE_HOME/bin:$PATH"
For Mac :
export PATH=~/installs/smile/bin
- Reload Terminal (or restart terminal)
For Ubuntu :
. .bashrc
For Mac :
. .bash_profile
- Run smile command on Terminal
~>smile
Smile Version - 3.3.8
To create a new project : "smile new <project-name>"
To create a new lib : "smile create-lib <lib-name>"
To export lib : "smile export-lib"
To reset the project : "smile spile"
Video reference:
# Setup Eclipse
Download eclipse: https://www.eclipse.org/downloads/packages/release/oxygen/3a
choose Eclipse IDE for Java EE Developers
Copy the downloaded installer into softwares folder: ~/installs/softwares
Install Eclipse by clicking on the installer.
Xtext installation:
- go to “Help” -> “Install New Software”
- add this url as the site to download the software from: http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
- once the site content loads, check Xtext -> Xtext Complete SDK and click Next
- In the next screen choose Xtext Complete SDK and click Next
- Accept the terms and conditions and proceed
- restart eclipse.
Installation Complete: With this the eclipse installation is complete.
If Smile is already installed. Copy the plugins from /smile/eclipse/plugins/ to Eclipse/Contents/Eclipse/dropins/plugins/
Video reference:
# Setup Intellij IDEA
Fllowing installation is for Ubuntu, IntelliJ version 2018.3.x. Please Download and install the mentioned version of IntelliJ for your operating system.
Download the above mentioned version of IntelliJ from the following link: https://www.jetbrains.com/idea/download/other.html
Copy the downloaded
ideaIC-2018.3.x.tar.gzto ~/installs/softwaresUnzip the
ideaIC-2018.3.x.tar.gz
> cd ~/installs/softwares
> softwares> tar -xvf ideaIC-2018.3.x.tar.gz
Open intelliJ
Install Scala plugin:
- Click on Configure -> Plugins
- Click on Browse Repositories
- Search for 'scala' (sort on downloads)
- Click on install
Install SBT plugin:
- Click on Configure -> Plugins
- Click on Browse Repositories
- Search for 'SBT' (sort on downloads)
- Click on install
Restart intelliJ and installation is complete
Video reference:
NOTE
The version of intelliJ mentioned in video could be outdated. Please refer the documentation above and download the specified version.
# New Smile Project
- Create a folder for your projects
~> mkdir projects
- Go inside the projects folder
~> cd projects
- To create a new Smile project: create a smile project by projects> smile new
<project_name>
TIP
While creating new project project_name must start with Capital.
A new folder with all small letters will be created within which all the project files will be placed.
projects> smile new Mould
projects> cd mould
- Run sbt (this takes sometime to download & setup).
projects/mould> sbt
- Run smile command run smile command insude sbt shell. Which will setup the project structure.
[Mould] $ smile
- Compile: run compile command to ensure no errors.
[Mould] $ compile
- Smile project is set.
Video reference:
# Import Project to Eclipse
Open eclipse
Go to File -> Import -> Existing Projects into Workspace
Browse to the new project’s home folder and select the k folder example: ~/projects/mould/k
Click on Finish
Should see the project successfully imported with no errors.
Video reference:
# Import Project to IntelliJ
Open intelliJ
Go to File -> New -> Project from Existing Sources
Choose the build.sbt inside the smile project folder example: ~/projects/mould/build.sbt
Set up Project SDK to java 1.8
Expand the Global SBT settings
Set up SMILE_HOME in VM parameters: -DSMILE_HOME=/home/
<user>/installs/smileclick OK
Project should get imported successfully.
Video reference:
# Install and Setup Mongo
- Download 3.2.x version from https://www.mongodb.com/download-center/community
Choose
Linux 64-bit legacy x64Download : https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.22.tgz
cd ~/installs
curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.22.tgz
tar -xvf mongodb-linux-x86_64-3.2.22.tgz
mv mongodb-linux-x86_64-3.2.22.tgz mongodb
- Create directory for mongo data at ~/db/mongo/data
cd /
mkdir db
cd db
mkdir mongo
cd mongo
mkdir data
cd data
pwd
- Create mongodbconfig
cd ~/installs/mongodb/bin
touch mongodbconfig
Paste the below content inside mongodbconfig and save
dbpath = <home_directory>/db/mongo/data
logpath = <home_directory>/db/mongo/mongodb.log
logappend = true
port = 27017
fork = true
#replSet = abc
- Create mongostart
cd ~/installs/mongodb/bin
touch mongostart
Paste the below content inside mongostart and save
sudo <home_directory>/installs/mongodb/bin/mongod --config <home_directory>/installs/mongodb/bin/mongodbconfig
- Create mongostop
cd ~/installs/mongodb/bin
touch mongostop
Paste the below content inside mongodbconfig and save
#!/bin/bash
pid=`ps -aef | grep mongod | grep config | tr -s " " | cut -f3 -d " "`;
if [ "${pid}" != "" ]; then
sudo kill -2 ${pid};
fi
Intro →