
In this post I will keep some useful Java hacks and one-liners which are useful in every day programming
In this post I will keep some useful Java hacks and one-liners which are useful in every day programming
This is the second tutorial about JBang. In the first one we covered the basics of this powerful scripting toolkit: Java scripting with JBang . We will now learn how to install Apps from its rich catalog and how to run scripts on the top of Apps.
This article describes how to fix the error “java.lang.OutOfMemoryError: Compressed class space error” which is an error that can occur on a 64-bit platform.
In this tutorial we will show how to measure the time spent on the execution of a Java method by using Byteman tool. There are several tools or product which can trace the execution of Java methods and calculate how much time you are spending in the single methods of your application. This is a … Read more
LDAP is commonly used in Security realms as a source of authentication and authorization information. This tutorial will teach you two simple strategies for starting an LDAP Server in minutes in order to secure your Enterprise applications. Option 1: Use an Embedded LDAP Server The first example is using an embedded ApacheDS LDAP server with … Read more
When using WildFly or JBoss EAP, the JAXB implementation is defined by the following specification in module.xml: <module name=”javax.xml.bind.api” xmlns=”urn:jboss:module:1.7″> <dependencies> <module name=”javax.activation.api” export=”true”/> <module name=”javax.xml.stream.api”/> <module name=”com.sun.xml.bind” services=”import”/> <module name=”javax.api”/> </dependencies> <resources> <resource-root path=”jboss-jaxb-api_2.3_spec-1.0.1.Final-redhat-1.jar”/> </resources> </module> In order to check the actual JAXB implementation, you can just create a new Instance of JAXBContext and … Read more
The error “java.lang.OutOfMemoryError: GC overhead limit exceeded” is fairly common for old JDK (mostly JDK 1.6 and JDK 1.7) . Let’see how to solve it. According to the JDK Troubleshooting guide, the “java.lang.OutOfMemoryError: GC overhead” limit exceeded indicates that the garbage collector is running all the time and Java program is making very slow progress. … Read more
There are over 70 Java-based open source machine learning projects listed on the MLOSS.org website, and probably many more unlisted projects live at university servers, GitHub, or Bitbucket. In this article, we will review the major libraries and platforms, the kind of problems they can solve, the algorithms they support, and the kind of data they can work with. … Read more
Today I had to write a quick code to find out which Java process is using a Port and eventually killed it. You can use it as template in case you have to manage OS process in Linux from Java code: import java.io.BufferedReader; import java.io.InputStreamReader; public class Execute { public static void main(String[] args) { … Read more
Here is a minimalist Java code which can be used to test if a port is available. In this example, we are checking for port 8080 by opening a new Socket to that port. We allow up to 10 retries if the port has been found already used. Enjoy it! import java.io.IOException; import java.net.Socket; public … Read more