Sunday, July 17, 2016

Install Oracle JDK with DrJava in Linux

DrJava runs fine in Linux, Mac and Windows.

Easy (but slightly inappropriate) route:

In case you do not have JDK installed,
Download JDK+netbeans bundle from
http://www.oracle.com/technetwork/articles/javase/jdk-netbeans-jsp-142931.html

Make it executable by using
chmod  +x   jdk-8u91-nb-8_1-linux-i586.sh

Install using
sudo ./ jdk-8u91-nb-8_1-linux-i586.sh



set default path using
sudo update-alternatives --install /usr/bin/java    java    /the/path/where/you/installed/jdk/bin/java  100
sudo update-alternatives --install /usr/bin/javac   javac  /the/path/where/you/installed/jdk/bin/javac 100



Take Drjava from my folder or download
https://www.cs.rice.edu/~javaplt/drjavarice/drjava.jar

Make it executable by using
chmod  +x   drjava.jar

run using
./drjava.rar


or make it runnable through double click by
right click
open with
/usr/bin/java  -jar


References
http://askubuntu.com/questions/159575/how-do-i-make-java-default-to-a-manually-installed-jre-jdk
http://annajiat.blogspot.com/2015/04/install-java-jdk-on-ubuntu-14-lts.html

Tuesday, March 10, 2015

Running Apache Cordova (formerly Adobe PhoneGap) on Windows

To build cross platform mobile apps based on web apps, Apache Cordova (formerly Adobe PhoneGap) is handy. This is a basic guide, so expect naive suggestions.

You might want to use the cloud build service instead of following this steps.

Requirements (customized from http://phonegap.com/install/)
1) Launch   NodeJS installer from administrator command prompt (must for Win8)
2) Disable desktop.ini and thumbs.db  (otherwise builds will fail)
Disable creation of desktop.ini from windows registry
Disable Windows thumbs.db files from being created
3) Install Git, choose custom, install optional UNIX tools that replaces sort/find.


Instructions from step 4 assumes there is no proxy. For proxy, follow (adapted from)
npm config set strict-ssl false
npm config set registry "http://registry.npmjs.org/"
npm config set proxy http://proxy:port_here
npm config set https-proxy http://proxy:port_here
npm --proxy http://proxy:port_here install -g packagename



4) Install ant from command line:
npm install -g ant
5) Install PhoneGap from command line:
npm install -g phonegap
6) Install Cordova from command line:
npm install -g cordova



If your proxy is 192.168.1.15 and port is 8080, it would look like
npm config set strict-ssl false
npm config set registry "http://registry.npmjs.org/"
npm config set proxy http://192.168.1.15:8080
npm config set https-proxy http://192.168.1.15:8080
npm --proxy http://192.168.1.15:8080 install -g ant
npm --proxy http://192.168.1.15:8080 install -g phonegap
npm --proxy http://192.168.1.15:8080 install -g cordova




7) For Android development,
7.1) install JDK (choose 32/64 bit as appropriate)
7.2) ensure system PATH variable is set to find java inside bin directory and JAVA_HOME is set to the directory/folder above the java bin folder
7.3) install Android SDK or Studio (SDK+IDE) matching JDK 32/64 bit
Set ANDROID_HOME
https://spring.io/guides/gs/android/
http://stackoverflow.com/questions/26356359/error-android-home-is-not-set-and-android-command-not-in-your-path-you-must-ful




8)  In case this is your first time installation of app outside google play store, in your android phone,
Open "Settings" from the Apps screen or notification bar, and then choose "Security."
Scroll down to Device Administration, and then check the "Unknown Sources" option.

9) Read PhoneGap documentation and follow up to (including) Command line interface
Before each build, search in your project directory/folder and delete desktop.ini and thumbs.db in case they came while copying/pasting folders. You might have to enable showing hidden files.

Test in emulator:
c:\>   cordova emulate android
Test in device:
plugin android phone to a USB2.0 port in your PC
c:\>   cordova run android

10) If you share the files over email / link, tell them, when prompted, to choose "Package Installer" or "Verify and install" to launch setup. Both works. Then to Click open. Sometimes installation from email attachments fails, it might be a good idea to upload somewhere and share the download link.