The following software is required to have an environment to develop Axional solutions

1 Eclipse 2020-06 JDK14

Download Eclipse 2020-06 to use with JDK14. You also need to upgrade to Gradle 6.3.

Pluggins

To install the plugins in Eclipse select “Help” -> “Install New Software…” and click “Add…” to add the following URL:

Copy
http://www.mihai-nita.net/eclipse

2 Java™ SE Development Kit (JDK™) 8

The JDK™ is a development environment for building applications, applets, and components using the Java programming language.

Go to Oracle website to download the Java™ Platform, Standard Edition Developement Kit:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Version

Version 8 is required to compile Axional solutions.

Choose the installer according to your platform.

Run the downloaded file and follow the steps:

3 Eclipse IDE for Java Developers

Eclipse is an integrated development environment (IDE) used in Java programming.

Go to Eclipse website to download Eclipse IDE for Java Developers:

https://eclipse.org/downloads/eclipse-packages

Run the application file and follow the steps.

Enter the directory where your Java projects will be stored:

Eclipse GUI should be as follows:

4 Configuration settings

4.1 Gradle

The default file of gradle definitions is called gradle.prefs2 located on the .settings directory. Rename the file to gradle.prefs and edit it to determine the correct values for the arguments:

  • project_path
  • project_dir
  • connection_project_dir

This is an example for this file:

Copy
{
  "1.0": {
    "project_path": ":axional-project",
    "project_dir": "/Users/user/workspace/axional-project",
    "connection_project_dir": "/Users/user/workspace/axional-project",
    "connection_gradle_user_home": null,
    "connection_gradle_distribution": "GRADLE_DISTRIBUTION(WRAPPER)",
    "connection_java_home": null,
    "connection_jvm_arguments": "",
    "connection_arguments": ""
  }
}

4.2 Classpath

Configure the correct classpath in the file .classpath located on the root of the project to avoid errors similar to:

Warning

Access restriction: The type 'TypeName' is not accessible due to restriction on required library rt.jar

This is an example for this file:

Copy
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src/main/java">
		<attributes>
			<attribute name="FROM_GRADLE_MODEL" value="true"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="src" path="src/test/java">
		<attributes>
			<attribute name="FROM_GRADLE_MODEL" value="true"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
	<classpathentry kind="output" path="bin"/>
</classpath>

4.3 Encoding

If you are having problems with your files encoding, check that your Eclipse Workspace is properly configured.
You can check it on Preferences -> General -> Workspace -> Text file encoding


Once you are on that page, under the section Text file encoding, you have two options:

  • Default: UTF-8 format
  • Other: ISO, UTC-ASCII or other formats you may bee interested. Generally, to solve possible encoding formats, ISO-8859-1 is the best option.

4.4 Configure rebase instead of merge

  1. Go to Eclipse->Preferences->Version Control->Git->Configuration
  2. Select the project
  3. Set the rebase flag to true or add it if not defined

5 Plugins

5.1 Eclipse Class Decompiler

Eclipse Class Decompiler is a plugin for the Eclipse platform. It integrates JD, Jad, FernFlower, CFR, and Procyon seamlessly with the Eclipse IDE. It displays all the Java sources during your debugging process, even if you do not have them all. And you can debug these class files directly without source code. It also integrates Javadoc and supports the syntax of JDK8 lambda expressions.

Read more at: The Features of Eclipse Class Decompiler

Install from: Eclipse-Class-Decompiler

5.2 Eclipse Memory Analizer

Using Eclipse Memory Analyzer

6 JVM monitoring

6.1 Setting HPROF (pre JDK 1.9)

During a test, you may need to generate HPROF samples. Go to Run Configurations and in the VM options tab put:

  • samples: The HPROF agent periodically samples the stack of all running threads to record the most frequently active stack traces. The count field above indicates how many times a particular stack trace was found to be active (not how many times a method was called). These stack traces correspond to the CPU usage hot spots in the application. This option does not require BCI or modifications of the classes loaded and of all the options causes the least disturbance of the application being profiled.
    Copy
    -Xrunhprof:cpu=samples,file=log.txt,depth=16
  • times: HPROF can collect CPU usage information by injecting code into every method entry and exit, keeping track of exact method call counts and the time spent in each method. This uses Byte Code Injection (BCI) and runs considerably slower than cpu=samples. Here the count represents the true count of the times this method was entered, and the percentages represent a measure of thread time spent in those method.
    Copy
    -Xrunhprof:cpu=times,file=log.txt,depth=16

6.2 Setting Visual VM pluggin

Since JDK1.9 HPROF is disabled. You an use VisualVM as profiler tool to replace HPROF. To install tha Visual VM pluggin follow instructions here

6.3 Java Flight Recorder With OpenJDK 11

Java Flight Recorder (JFR) used to be a commercial add-on of the Oracle JDK. As it’s been open sourced along with Java Mission Control, everyone using OpenJDK 11 can now troubleshoot their Java apps with this excellent tool for free of charge. JFR, previous proprietary solution, might be lesser known for those relying on previous versions of OpenJDK. Therefore, I thought it was worth writing a fresh post on using JFR with OpenJDK 11.

Copy
-Dcom.sun.management.jmxremote=true 
-Dcom.sun.management.jmxremote.port=3614 
-Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false
-XX:+UnlockCommercialFeatures 
-XX:+FlightRecorder

You can use JFR to run a java test, generate a .jfr file to later analize it with Java Mision Control.

Copy
-XX:+FlightRecorder -XX:StartFlightRecording=filename=/tmp/flight.jfr

6.4 Java Mision Control Eclipse pluggin

Java Mission Control can be downloaded and installed using the Eclipse Update Site facility. The following URL functions as an update site. Novice users can follow the step-by-step instructions.

Read about here