<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Java on widerin</title><link>http://widerin.net/tags/java/</link><description>Recent content in Java on widerin</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 07 Sep 2026 18:30:36 +0200</lastBuildDate><atom:link href="http://widerin.net/tags/java/index.xml" rel="self" type="application/rss+xml"/><item><title>Gitlab Security Products with Java and Gradle</title><link>http://widerin.net/posts/2020/gitlab-security-products-with-java-and-gradle/</link><pubDate>Sun, 08 Mar 2020 00:00:00 +0000</pubDate><guid>http://widerin.net/posts/2020/gitlab-security-products-with-java-and-gradle/</guid><description>&lt;p&gt;GitLab security products have been constantly improving support for different
build tools and programming languages.&lt;/p&gt;
&lt;p&gt;My &lt;a href="https://gitlab.com/gitlab-org/security-products/license-management/merge_requests/7"&gt;recent contribution&lt;/a&gt;
to &lt;a href="https://docs.gitlab.com/ee/user/compliance/license_compliance/#license-compliance"&gt;License compliance&lt;/a&gt; allows now to inject commands &lt;code&gt;SETUP_CMD&lt;/code&gt; environment
variable to the core to bypass the package manager auto-detection and make use
of the &lt;code&gt;./gradlew&lt;/code&gt; &lt;a href="https://gradle.org"&gt;Gradle&lt;/a&gt; wrapper script.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;include:
- template: Security/License-Scanning.gitlab-ci.yml
variables:
SETUP_CMD: sh my-custom-install-script.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, my-custom-install-script.sh is a shell script at the root
directory of your project.&lt;/p&gt;</description></item><item><title>Java versions on macOS</title><link>http://widerin.net/posts/2020/java-versions-on-macos/</link><pubDate>Fri, 21 Feb 2020 00:00:00 +0000</pubDate><guid>http://widerin.net/posts/2020/java-versions-on-macos/</guid><description>&lt;p&gt;On macOS you can use &lt;code&gt;/usr/libexec/java_home&lt;/code&gt; command to control your used Java
version. As a lot of applications and/or projects still require Java 1.8 or you
might want to use an alternative JDK/JRE let&amp;rsquo;s look into managing those
different versions.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ /usr/libexec/java_home -h
Usage: java_home [options...]
Returns the path to a Java home directory from the current user&amp;#39;s settings.
Options:
[-v/--version &amp;lt;version&amp;gt;] Filter Java versions in the &amp;#34;JVMVersion&amp;#34; form 1.X(+ or *).
[-a/--arch &amp;lt;architecture&amp;gt;] Filter JVMs matching architecture (i386, x86_64, etc).
[-d/--datamodel &amp;lt;datamodel&amp;gt;] Filter JVMs capable of -d32 or -d64
[-t/--task &amp;lt;task&amp;gt;] Use the JVM list for a specific task (Applets, WebStart, BundledApp, JNI, or CommandLine)
[-F/--failfast] Fail when filters return no JVMs, do not continue with default.
[ --exec &amp;lt;command&amp;gt; ...] Execute the $JAVA_HOME/bin/&amp;lt;command&amp;gt; with the remaining arguments.
[-R/--request] Request installation of a Java Runtime if not installed.
[-X/--xml] Print full JVM list and additional data as XML plist.
[-V/--verbose] Print full JVM list with architectures.
[-h/--help] This usage information.
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="manual-installation"&gt;Manual installation&lt;/h2&gt;
&lt;p&gt;For this post I&amp;rsquo;ve decided to use &lt;a href="https://adoptopenjdk.net/installation.html"&gt;AdoptOpenJDK&lt;/a&gt; as it&amp;rsquo;s actively maintained.&lt;/p&gt;</description></item><item><title>Gitlab License Management with Java 11</title><link>http://widerin.net/posts/2018/gitlab-license-management-with-java-11/</link><pubDate>Fri, 21 Dec 2018 00:00:00 +0000</pubDate><guid>http://widerin.net/posts/2018/gitlab-license-management-with-java-11/</guid><description>&lt;p&gt;If built-in &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/license_management.html"&gt;License Management&lt;/a&gt; functionality does not support the programming
language requirements you have, you can customize the &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/license_management.html"&gt;License Management&lt;/a&gt;
docker image.&lt;/p&gt;
&lt;p&gt;This guide shows you how to use &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/license_management.html"&gt;License Management&lt;/a&gt; with &lt;a href="https://openjdk.java.net/"&gt;OpenJDK&lt;/a&gt; 11 or
later.&lt;/p&gt;
&lt;h2 id="license-management-definition"&gt;License Management definition&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/license_management.html"&gt;License Management&lt;/a&gt; helps you find what licenses your project uses in its
dependencies and decide for each of then whether to allow it or forbid it.&lt;/p&gt;
&lt;div class="gallery shadow" itemscope itemtype="https://schema.org/ImageGallery"&gt;
&lt;figure itemprop="associatedMedia" itemscope itemtype="https://schema.org/ImageObject"&gt;
&lt;a class="glightbox" href="https://docs.gitlab.com/ee/user/compliance/license_compliance/img/license_compliance_v13_0.png" data-gallery="gallery-0" data-glightbox="description: License Compliance report under pipelines" itemprop="contentUrl"&gt;
&lt;img loading="lazy" src="https://docs.gitlab.com/ee/user/compliance/license_compliance/img/license_compliance_v13_0.png" alt="License Compliance report under pipelines" itemprop="thumbnail"&gt;
&lt;/a&gt;
&lt;figcaption&gt;&lt;p&gt;License Compliance report under pipelines&lt;/p&gt;</description></item><item><title>GitLab SAST and Java 11</title><link>http://widerin.net/posts/2018/gitlab-sast-and-java-11/</link><pubDate>Wed, 19 Dec 2018 00:00:00 +0000</pubDate><guid>http://widerin.net/posts/2018/gitlab-sast-and-java-11/</guid><description>&lt;p&gt;If built-in &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/sast.html"&gt;Static Application Security Testing&lt;/a&gt;
functionality does not support the programming language requirements you have,
you can customize the analyzer docker images in [GitLab]&amp;rsquo;s &lt;code&gt;sast&lt;/code&gt; pipeline job.&lt;/p&gt;
&lt;p&gt;This guide shows you how to use &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/sast.html"&gt;SAST&lt;/a&gt; with &lt;a href="https://openjdk.java.net/"&gt;OpenJDK&lt;/a&gt; 11 or later.&lt;/p&gt;
&lt;h2 id="sast-definition"&gt;SAST definition&lt;/h2&gt;
&lt;p&gt;Static Application Security Testing provides you information if&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;your application is vulnerable by using an external library in a specific
version which is known to be vulnerable or&lt;/li&gt;
&lt;li&gt;your code has a potentially dangerous attribute in a class, or unsafe code
that can lead to unintended code execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="gallery shadow" itemscope itemtype="https://schema.org/ImageGallery"&gt;
&lt;figure itemprop="associatedMedia" itemscope itemtype="https://schema.org/ImageObject"&gt;
&lt;a class="glightbox" href="https://docs.gitlab.com/ee/user/application_security/security_dashboard/img/pipeline_security_dashboard_v13_3.png" data-gallery="gallery-0" data-glightbox="description: Project Security Dashboard" itemprop="contentUrl"&gt;
&lt;img loading="lazy" src="https://docs.gitlab.com/ee/user/application_security/security_dashboard/img/pipeline_security_dashboard_v13_3.png" alt="Project Security Dashboard" itemprop="thumbnail"&gt;
&lt;/a&gt;
&lt;figcaption&gt;&lt;p&gt;Project Security Dashboard&lt;/p&gt;</description></item></channel></rss>