Tuesday, January 20, 2015

IntelliJ IDEA: installation

https://www.jetbrains.com/idea/download/

Java: classes & methods

https://sites.google.com/site/chicagoandroid/050/java-class

Java: syntax

https://sites.google.com/site/chicagoandroid/050/java-syntax

Java: OOP

https://sites.google.com/site/chicagoandroid/050/050a

Windows: command line emulator for Unix

Cygwin:


https://cygwin.com/install.html

Java: installation



Find out if you have Java


$ which java

/usr/bin/java

$ whereis java
/usr/bin/java

$ ls -al /usr/bin/java | grep java
lrwxr-xr-x  1 root  wheel  74 Nov 17 08:13 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

Verify that you have Java version 1.8


$ java -version
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b05)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b05, mixed mode)

uki@ CNH_PROD $ 


Install Java if you need it


Windows:
https://www.java.com/en/download/help/windows_manual_download.xml


Mac:
https://www.java.com/en/download/faq/java_mac.xml


Linux:
https://www.java.com/en/download/help/linux_x64_install.xml

Friday, January 16, 2015

UNIX: import public key


On Server:

cd .ssh
ls
cat ../id_rsa.pub >> authorized_keys 
cat authorized_keys 
cd

rm -fr id_rsa.pub 

Java: find jar

When you are looking for a given Java class, you can use this online database to locate jars:

Example, looking for log4j

http://www.findjar.com/index.x?query=log4j

Among others I get response:

[JAR] log4j-1.1.3.jar in log4j/log4j/1.1.3
[JAR] log4j-1.2.11.jar in log4j/log4j/1.2.11
[JAR] log4j-1.2.12.jar in log4j/log4j/1.2.12



Maven: installing apk, or arr, or jar in .m2

Sometimes you get a built artifact (apk, arr, jar) and instead of keeping it in your Downloads, or com up with a nice folder structure, you can simply put it in your Maven .m2 repository, that what it is designed for.


$ mvn install:install-file -Dpackaging=apk -DgroupId=com. mycompany.android -DartifactId= SomeApp -Dversion=1.4.42.0 -Dfile=/Users/uki/Downloads/SomeApp-1.4.42.0.apk

[INFO] Scanning for projects...

[INFO]                                                                         

[INFO] ------------------------------------------------------------------------

[INFO] Building Maven Stub Project (No POM) 1

[INFO] ------------------------------------------------------------------------

[INFO] 

[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---

[INFO] Installing /Users/uki/Downloads/SomeApp-1.4.42.0.apk to /Users/uki/.m2/repository/com/mycompany/android/SomeApp/1.4.42.0/SomeApp-1.4.42.0.apk

[INFO] Installing .../Users/uki/.m2/repository/com/mycompany/android/SomeApp/1.4.42.0/SomeApp-1.4.42.0.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

Thursday, January 15, 2015

Linux: set date manually

If you have a linux board that has no access to Internet, you might have to set the date manually.

root@imx6qsabrelite:~# date -s "15 JAN 2015 13:50:00"Thu Jan 15 13:50:00 CST 2015root@imx6qsabrelite:~# dateThu Jan 15 13:50:02 CST 2015