Java

Most of these notes are from the book Java Projects by Peter Verhas.

Maven build lifecycle targets

From the official documentation.

JConsole over SSH with SOCKS Proxy

This is from here: Create the SSH socks proxy locally on some free port (e.g. 7777):

ssh -fN -D 7777 user@firewalled-host

Run JConsole by specifying the SOCKS proxy (e.g. localhost:7777) and the address for the JMX server (e.g. localhost:2147)

jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=7777 service:jmx:rmi:///jndi/rmi://localhost:2147/jmxrmi -J-DsocksNonProxyHosts=

JShell

Javap

Jar files

These are zip files that have a META-INF folder with a Manifest.mf file inside.

To create a jar file:

jar -cf hello.jar HelloWorld.class

And to run:

java -cp hello.jar HelloWorld

To see contents of a jar:

jar -tf hello.jar

Runtime/debugging

Maven

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
            <source>1.11</source>
            <target>1.11</target>
            <release>11</release>
        </configuration>
      </plugin>
    </plugins>
  </build>

Interfaces

Field types

Things to find out later