Java - ilya-khadykin/notes-outdated GitHub Wiki

TO DO:

Topics:

  1. Java Overview
  2. Java Versions
  3. Programming in Java: Basic Concepts
  4. Basics of OOP in Java
  5. Basics of Java Syntax
  6. Handling Exceptions in Java
  7. Java IO Libraries
  8. Java Style Guidelines
  9. Primitive data types in Java
  10. Reference types in Java
  11. Type Conversion in Java
  12. How To Develop A Class in Java
  13. Java library

Code Review:

Practical examples:

Other Non-Java Languages on the JVM

  • Groovy
    Most mature and easiest for Java developers to learn
  • Scala
    Statically typed with immutables; a good transitional language from OOP to functional programming
  • Clojure
    Lisp on the JVM; pure functional language with immutables
  • JRuby
    Compiles Ruby
  • Jython
    Compiles Python

Build automation Software for Java

  • Ant - build.xml
  • Gradle - build.gradle
  • Maven - pom.xml

Java + Gradle

./gradlew
./gradlew clean build

Configuration

Adding self-signed certificate to JVM keystore

echo -n | openssl s_client -connect example.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/examplecert.crt
openssl x509 -in /tmp/examplecert.crt -text
sudo keytool -import -trustcacerts -keystore /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts -storepass changeit -noprompt -alias mycert -file /tmp/examplecert.crt

Notes

Find out about dependencies for compiled classes:

javap ClassName

Execute compiled Groovy classes:

java -cp $GROOVY_HOME/embeddable/groovy-all-2.4.7.jar:. class_name # unix
or
java -cp %GROOVY_HOME%\embeddable\groovy-all-2.4.7.jar:. class_name # windows
⚠️ **GitHub.com Fallback** ⚠️