background preloader

Java

Facebook Twitter

Performance

Jcd. Refcard. Binding. Jdk. Parser. Standard concise way to copy a file in Java. Orion-ssh2. Check the class version - Real's Java How-to. Check the class versionTag(s): Environment The first 4 bytes are a magic number, 0xCAFEBABe, to identify a valid class file then the next 2 bytes identify the class format version (major and minor).

Check the class version - Real's Java How-to

Possible major/minor value : major minor Java platform version 45 3 1.0 45 3 1.1 46 0 1.2 47 0 1.3 48 0 1.4 49 0 1.5 50 0 1.6 > java ClassVersionChecker ClassVersionChecker.class ClassVersionChecker.class: 49 . 0 from The Java Virtual Machine Specification magic The magic item supplies the magic number identifying the class file format; it has the value 0xCAFEBABE. minor_version, major_version The values of the minor_version and major_version items are the minor and major version numbers of this class file.Together, a major and a minor version number determine the version of the class file format.

Logging to the syslog from a java application « JTeam Blog / JTeam: Enterprise Java, Open Source, software solutions, Amsterdam. Every application needs logging, it can help you during development and when debugging those annoying things that do not work in production.

Logging to the syslog from a java application « JTeam Blog / JTeam: Enterprise Java, Open Source, software solutions, Amsterdam

One question is where to put the logging events. All linux servers use a system log to log events that take place on the operating system level. You can find logs for the kernel, deamons, user actions and a lot of other items. The nice part about system logging is that maintenance people will always know where to look and that it is possible to use one server for logging. At the moment I am on a project that uses a fair amount of servers.

An application running in Tomcat does not log to the system log by default. Troubleshooting System Crashes - Troubleshooting Guide for Java SE 6 with HotSpot VM. Pentaho Commercial Open Source Business Intelligence Kettle Project. Forums and JIRA There are two primary ways to make sure that your contributions are recognized and reviewed in a timely fashion: through our Discussion Forums and through our issue and bug tracking system, JIRA.

Pentaho Commercial Open Source Business Intelligence Kettle Project

Reporting a bug All bug reports are recorded and tracked through our JIRA issue and bug tracking system. Internationalized contributions The place to start with a language specific contribution is to look under our International Forums for the language you're interested in. Contributing code We rely on time and code contributions from our community to keep our commitment of delivering a quality Business Intelligence platform in the open source scenario. Submitting code Both bug fixes, new features and improvements are types inputs in our JIRA system, allowing you to choose the type appropriated to your case. Contributing documentation If you'd like to contribute documentation improvements, or submit a technical article, you can do so in the Pentaho Documentation Wiki. Solutions. Fork-Join Development in Java SE. Edward Harned (eh at coopsoft dot com) Senior Developer, Cooperative Software Systems, Inc.

Fork-Join Development in Java SE

February, 2010 [updated June, 2013]Serbo-Croatian translation on June, 2013.What is Fork-Join? Think of a fork in the road where each path eventually comes back together — joins.Fork-Join breaks an application into several parts for parallel processing and joins the results at the end.Figure 1: Fork-Join Structure Let’s say we have an array of one thousand numbers. We need to do a procedure on each of these numbers and add the total.Listing 1: Array ProcessingIf the procedure takes one second (wall-clock time) to complete, then it is going to take one thousand seconds (over 16½ minutes) to complete this task.Fork-Join couldseparate (fork) the large array into ten arrays of one hundred elements each,processes each array on a separate CPU, andjoin the results when finished.That would take one hundred seconds (just over 1½ minutes), one tenth of the original time.

DBCP - Configuration. NOTE: If maxIdle is set too low on heavily loaded systems it is possible you will see connections being closed and almost immediately new connections being opened.

DBCP - Configuration

This is a result of the active threads momentarily closing connections faster than they are opening them, causing the number of idle connections to rise above maxIdle. The best value for maxIdle for heavily loaded system will vary but the default is a good starting point. This component has also the ability to pool PreparedStatements. When enabled a statement pool will be created for each Connection and PreparedStatements created by one of the following methods will be pooled: public PreparedStatement prepareStatement(String sql) public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) NOTE - Make sure your connection has some resources left for the other statements.

When allowed you can access the underlying connection using the following construct: Java Programming Notes. Understanding Weak References. IntelliJ and Garbage Collection « Piotr Gabryanczyk’s Blog. IntelliJ and Garbage Collection Posted by Piotr Gabryanczyk on December 12, 2006 I recently read the article about garbage collection (here) and decided to tweak my IntelliJ settings.

IntelliJ and Garbage Collection « Piotr Gabryanczyk’s Blog

6 Common Errors in Setting Java Heap Size. Two JVM options are often used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size.

6 Common Errors in Setting Java Heap Size

Here are some common mistakes I have seen when using them: Missing m, M, g or G at the end (they are case insensitive).