Bundling Java Runtime Environments

deployexpert created the topic: Bundling Java Runtime Environments
Since InstallAnywhere installers are Java based, they require a Java Virtual Machine
(VM) to run. InstallAnywhere installers can bundle a virtual machine with the
installer, thus eliminating the possibility that the installer will not find a suitable
virtual machine for the product or for the installer.
Developers can choose whether or not the end-user will have a choice of VMs to use
for the installed product.
InstallAnywhere installers run from the bundled virtual machine. In order to bundle a
virtual machine, it must be packaged as a VM Pack. Free VM packs may be found on
the Macrovision Web site (details on how to create your own VM Packs can be found
below).
A VM will not be installed under the following conditions:

Tagged :

Creating Launchers for Java Applications

deployexpert created the topic: Creating Launchers for Java Applications
InstallAnywhere provides an action that is available from the Install task which will
create launchers for Java applications. Click the Create Launcher button. This action
creates a platform-native executable for launching a Java application (also known as a
LAX executable). This LAX allows Java applications to be launched as if they were
platform-native (for example, the LaunchAnywhere executable can be launched by
double-clicking or by being called directly from the command line). A
LaunchAnywhere executable is also responsible for invoking the Java runtime, setting
the environment for the Java application, and passing any command line arguments
that may be required by the application.
When adding a LaunchAnywhere action you will be given the option to search for the
main class of your Java application. You can let InstallAnywhere find it for you, or you
can enter it yourself. You can also define the command line arguments that should to
be passed to your Java application when the LaunchAnywhere executable is run.
On Windows, InstallAnywhere will append .exe to the file. On Mac OS X, it will create
a .app package.
Defining the Launcher Type allows developers to specify whether the Java application
is either a GUI-based application calling javaw.exe (stdout and stderr suppressed by
default), or a console application calling java.exe (stdout and stderr directed to the
console by default). In addition, on Windows systems, console launchers will redirect
stdout and stderr output to the same console window from which they were invoked.
The Launcher Icon enables developers to select the icon to be used for the LAX
executable on the Mac OS X and Windows platforms. Custom icons are not available
on Unix installers. Mac OS X icons may be 128 x 128.

Tagged :

Any Possible Software/Plugin FoR SCM Workflow

pankaj2252369@gmail.com created the topic: Any possible Software/plugin for SCM workflow?
Hey Team, Thanks for lot of information on the site. wonderful work.

Any idea on SCM workflow software/framework ? which would help me to complete the SDLC lifecycle.

For E.g: When ever developers are done with their changes/check-ins, they would request CM team to build (via Email), And when CM builds and deploy , they will email to Testing Team, finally when its been tested they will let CM/RM team inform about the bugs, etc. finally product will be released.

All this was happening manually(via emails). If we have a workflow software, so that we can have everything in process oriented and SCM would be very easy.

Any Suggestion are welcome.

If know of any plug-ins , we can extend our programs to make it work to our systems.

Thanks in Advance!

rajeshkumar replied the topic: Re: Any possible Software/plugin for SCM workflow?
I would suggest following in Commercial | Opensource:-
SCM Workflow consisit of following..
SCM Tools |Scripting |Build / WorkFlow Mgmt Tools |
| Release / Dep Tools | Security | Testing Tools |
Test Coverage | Source-code Analysis | Issue Tracking Tools | IDEs Integration |Virtualization |

Please find list of tools and find you combination based in your project requirement and budget

Build / WorkFlow Mgmt Tools

AnthillPro
Apache Continuum
Bamboo
CruiseControl
Hudson
LuntBuild
OpenMake Meister
TeamCity
Team Foundation Server
Electric Cloud

SCM Tools

AccuRev
ClearCase
CA Harvest
CVS
Dimensions
Git
MKS Source Integrity
Mercurial
Perforce
PVCS
StarTeam
Subversion
Synergy
Team Foundation Server
Vault
ViewVC
VSS

Scripting

Ant
Groovy
Make
Maven
MSBuild
NAnt
Shell Scripts
Perl Scripts
Visual Studio

Release / Dep Tools
Cruise
Rational Team Concert
Manual

Security

Active Directory
Kerberos
LDAP
Single Sign-on
RSA SecurID

Testing Tools
Clover
Cobertura
Emma

Source-code Analysis

Checkstyle
CodeSonar
Coverity
FindBugs
Fortify
Klocwork
PMD
Sonar

Issue Tracking Tools

Bugzilla
ClearQuest
HP Quality Center
JIRA
PVCS Tracker
Team Foundation Server
TeamTrack
VersionOne

IDEs Integration

Eclipse
RAD
Visual Studio

Virtualization

VMWare Lab Manager
Microsoft
Amazon (Elastic Cloud)
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

pankaj2252369@gmail.com replied the topic: Re: Any possible Software/plugin for SCM workflow?
Thanks for the response. But this i snot actually i am looking for.. I have idea on the mentioned tools. But wanted to create one separate tool for our internal purpose. So i am just checking, if there are any SCM related plugins /frame works in market, So that i do not spend more time on the things that are available.

Anyways.. Thank you so much!

rajeshkumar replied the topic: Re: Any possible Software/plugin for SCM workflow?
Hi John,

May be i am getting confused from you questions. Framework which can help you to develop your internal tools????

You mean you would like to develop your own tools, Then you might want to identify the technology first using which you want your development work get started. There are plenty of framework in Java| C++ | Perl | Pythin| Php | Ruby on rails etc
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged : / / / / /

Java Installation Process in Linux – Complete guide

java-installation-in-linux

Download, Install and Configure JDK 8 & JRE 8

Platfrom – Debian & Ubuntu

#JRE8 - Package contains just the Java Runtime Environment 8
$ sudo apt-get install openjdk-8-jre

#JKD8 - Package contains just the Java Developement Environment 8
$ sudo apt-get install openjdk-8-jdk

Platfrom – Fedora, Oracle Linux, Red Hat Enterprise Linux, etc

#JRE8 - Package contains just the Java Runtime Environment 8
$ su -c “yum install java-1.8.0-openjdk”

#JKD8 - Package contains just the Java Developement Environment 8
$ su -c "yum install java-1.8.0-openjdk-devel"

$ wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm"

$ wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm

curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm > jdk-8u112-linux-x64.rpm

Platfrom – All platforms of Linux, Windows and Mac in Tar ball format

$ wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz

$ wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz"

$ wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

How to set JAVA in Linux System?

$ export JAVA_HOME=/opt/jdk1.8.0_144/
$ export PATH=/opt/jdk1.8.0_144/bin:$PATH;

Download, Install and Configure JDK 7 & JRE 7

Platfrom – Debian & Ubuntu

#JRE7 - Package contains just the Java Runtime Environment 7
$ sudo apt-get install openjdk-7-jre

#JKD7 - Package contains just the Java Developement Environment 7
$ sudo apt-get install openjdk-7-jdk

Platfrom – Fedora, Oracle Linux, Red Hat Enterprise Linux, etc

$ su -c “yum install java-1.7.0-openjdk”

$ su -c “yum install java-1.7.0-openjdk-devel”

Platfrom – All platforms of Linux, Windows and Mac in Tar ball format

wget –no-cookies –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com” “http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz”

wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz

curl -v -j -k -L -H “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm > jdk-7u79-linux-x64.rpm

JDK 6
Debian, Ubuntu, etc.
On the command line, type:
$ sudo apt-get install openjdk-6-jre
The openjdk-6-jre package contains just the Java Runtime Environment.
$ sudo apt-get install openjdk-6-jdk
If you want to develop Java programs then install the openjdk-6-jdk package.
Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c “yum install java-1.6.0-openjdk”
The java-1.6.0-openjdk package contains just the Java Runtime Environment.
$ su -c “yum install java-1.6.0-openjdk-devel”
If you want to develop Java programs then install the java-1.6.0-openjdk-devel package.

 

 

Tagged : / / / / / / / / / / / / /

The jstack Utility | jstack Tutorial | scmGalaxy

jstack-utility

The release of JDK 8 introduced Java Mission Control, Java Flight Recorder, and jcmd utility for diagnosing problems with JVM and Java applications. It is suggested to use the latest utility, jcmd instead of the previous jstack utility for enhanced diagnostics and reduced performance overhead.

The following sections describe troubleshooting techniques with jstack utility.

2.16.1 Troubleshoot with jstack Utility

The jstack command-line utility attaches to the specified process or core file and prints the stack traces of all threads that are attached to the virtual machine, including Java threads and VM internal threads, and optionally native stack frames. The utility also performs deadlock detection.

The utility can also use the jsadebugd daemon to query a process or core file on a remote machine. Note: The output takes longer to print in this case.

A stack trace of all threads can be useful in diagnosing a number of issues, such as deadlocks or hangs.

The -l option, which instructs the utility to look for ownable synchronizers in the heap and print information about java.util.concurrent.locks. Without this option, the thread dump includes information only on monitors.

The output from the jstack pid option is the same as that obtained by pressing Ctrl+\ at the application console (standard input) or by sending the process a QUIT signal. See Control+Break Handler for an output example.

Thread dumps can also be obtained programmatically using the Thread.getAllStackTraces method, or in the debugger using the debugger option to print all thread stacks (the where command in the case of the jdb sample debugger).

For more details on the jstack utility, see the jstack command man page.

2.16.2 Force a Stack Dump

If the jstack pid command does not respond because of a hung process, then the -F option can be used (on Oracle Solaris and Linux operating systems only) to force a stack dump, as shown in Example 2-29.

Example 2-29 Force a Stack Dump with jstack Utility

$ jstack -F 8321 Attaching to process ID 8321, please wait... Debugger attached successfully. Client compiler detected. JVM version is 1.6.0-rc-b100 Deadlock Detection: Found one Java-level deadlock: ============================= "Thread2": waiting to lock Monitor@0x000af398 (Object@0xf819aa10, a java/lang/String), which is held by "Thread1" "Thread1": waiting to lock Monitor@0x000af400 (Object@0xf819aa48, a java/lang/String), which is held by "Thread2" Found a total of 1 deadlock. Thread t@2: (state = BLOCKED) Thread t@11: (state = BLOCKED) - Deadlock$DeadlockMakerThread.run() @bci=108, line=32 (Interpreted frame) Thread t@10: (state = BLOCKED) - Deadlock$DeadlockMakerThread.run() @bci=108, line=32 (Interpreted frame) Thread t@6: (state = BLOCKED) Thread t@5: (state = BLOCKED) - java.lang.Object.wait(long) @bci=-1107318896 (Interpreted frame) - java.lang.Object.wait(long) @bci=0 (Interpreted frame) - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=116 (Interpreted frame) - java.lang.ref.ReferenceQueue.remove() @bci=2, line=132 (Interpreted frame) - java.lang.ref.Finalizer$FinalizerThread.run() @bci=3, line=159 (Interpreted frame) Thread t@4: (state = BLOCKED) - java.lang.Object.wait(long) @bci=0 (Interpreted frame) - java.lang.Object.wait(long) @bci=0 (Interpreted frame) - java.lang.Object.wait() @bci=2, line=485 (Interpreted frame) - java.lang.ref.Reference$ReferenceHandler.run() @bci=46, line=116 (Interpreted frame)

2.16.3 Stack Trace from a Core Dump

To obtain stack traces from a core dump, execute the jstack command on a core file, as shown in Example 2-30.

Example 2-30 Stack Trace from a Core Dump

$ jstack $JAVA_HOME/bin/java core

2.16.4 Mixed Stack

The jstack utility can also be used to print a mixed stack; that is, it can print native stack frames in addition to the Java stack. Native frames are the C/C++ frames associated with VM code and JNI/native code.

To print a mixed stack, use the -m option, as shown in Example 2-31.

Example 2-31 Mixed Java Stack with jstack Utility

$ jstack -m 21177 Attaching to process ID 21177, please wait... Debugger attached successfully. Client compiler detected. JVM version is 1.6.0-rc-b100 Deadlock Detection: Found one Java-level deadlock: ============================= "Thread1": waiting to lock Monitor@0x0005c750 (Object@0xd4405938, a java/lang/String), which is held by "Thread2" "Thread2": waiting to lock Monitor@0x0005c6e8 (Object@0xd4405900, a java/lang/String), which is held by "Thread1" Found a total of 1 deadlock. ----------------- t@1 ----------------- 0xff2c0fbc __lwp_wait + 0x4 0xff2bc9bc _thrp_join + 0x34 0xff2bcb28 thr_join + 0x10 0x00018a04 ContinueInNewThread + 0x30 0x00012480 main + 0xeb0 0x000111a0 _start + 0x108 ----------------- t@2 ----------------- 0xff2c1070 ___lwp_cond_wait + 0x4 0xfec03638 bool Monitor::wait(bool,long) + 0x420 0xfec9e2c8 bool Threads::destroy_vm() + 0xa4 0xfe93ad5c jni_DestroyJavaVM + 0x1bc 0x00013ac0 JavaMain + 0x1600 0xff2bfd9c _lwp_start ----------------- t@3 ----------------- 0xff2c1070 ___lwp_cond_wait + 0x4 0xff2ac104 _lwp_cond_timedwait + 0x1c 0xfec034f4 bool Monitor::wait(bool,long) + 0x2dc 0xfece60bc void VMThread::loop() + 0x1b8 0xfe8b66a4 void VMThread::run() + 0x98 0xfec139f4 java_start + 0x118 0xff2bfd9c _lwp_start ----------------- t@4 ----------------- 0xff2c1070 ___lwp_cond_wait + 0x4 0xfec195e8 void os::PlatformEvent::park() + 0xf0 0xfec88464 void ObjectMonitor::wait(long long,bool,Thread*) + 0x548 0xfe8cb974 void ObjectSynchronizer::wait(Handle,long long,Thread*) + 0x148 0xfe8cb508 JVM_MonitorWait + 0x29c 0xfc40e548 * java.lang.Object.wait(long) bci:0 (Interpreted frame) 0xfc40e4f4 * java.lang.Object.wait(long) bci:0 (Interpreted frame) 0xfc405a10 * java.lang.Object.wait() bci:2 line:485 (Interpreted frame) ... more lines removed here to reduce output... ----------------- t@12 ----------------- 0xff2bfe3c __lwp_park + 0x10 0xfe9925e4 AttachOperation*AttachListener::dequeue() + 0x148 0xfe99115c void attach_listener_thread_entry(JavaThread*,Thread*) + 0x1fc 0xfec99ad8 void JavaThread::thread_main_inner() + 0x48 0xfec139f4 java_start + 0x118 0xff2bfd9c _lwp_start ----------------- t@13 ----------------- 0xff2c1500 _door_return + 0xc ----------------- t@14 ----------------- 0xff2c1500 _door_return + 0xc

Frames that are prefixed with an asterisk (*) are Java frames, whereas frames that are not prefixed with an asterisk are native C/C++ frames.

The output of the utility can be piped through c++filt to demangle C++ mangled symbol names. Because the Java HotSpot VM is developed in the C++ language, the jstack utility prints C++ mangled symbol names for the Java HotSpot internal functions.

The c++filt utility is delivered with the native C++ compiler suite: SUNWspro on Oracle Solaris operating system and gnu on Linux.

Tagged : / / / / / / / / /

How to Run/Deploy Java EE applications on Amazon EC2?

running-java-ee-applications-on-amazon-ec2

Running Java EE applications on Amazon EC2: deploying to 20 machines with no money down

Computer hardware has traditionally been a scarce, expensive resource. In the early days of computing developers had to share a single machine. Today each developer usually has their own machine but it’s rare for a developer to have more than one. This means that running performance tests often involves scavenging for machines.  Likewise, replicating even just part of a production environment is a major undertaking. With Amazon’s Elastic Compute Cloud (EC2), however, things are very different. A set of Linux servers is now just a web service call away. Depending on the type of the servers you simply pay 10-80 cents per server per hour for up to 20 servers! No more upfront costs or waiting for machines to be purchased and configured.

To make it easier for enterprise Java developers to use EC2, I have created EC2Deploy.  It’s a Groovy framework for deploying an enterprise Java application on a set of Amazon EC2 servers. EC2Deploy provides a simple, easy to use API for launching a set of EC2 instances; configuring MySQL, Apache and one or more Tomcat servers; and deploying one or more web applications. In addition, it can also run JMeter and collect performance metrics.

Here is an example script that launches some EC2 instances; configures MySQL with one slave, Tomcat and Apache; deploys a single web application on the Tomcat server; and runs a JMeter test with first one thread and then two.

class ClusterTest extends GroovyTestCase {
  void testSomething() {
    AWSProperties awsProperties = new
        AWSProperties("/…/aws.properties")

    def ec2 = new EC2(awsProperties)

    def explodedWar = '…/projecttrack/webapp/target/ptrack'

    ClusterSpec clusterSpec =
       new ClusterSpec()
            .schema("ptrack", ["ptrack": "ptrack"],
                    ["src/test/resources/testdml1.sql",
                     "src/test/resources/testdml2.sql"])
            .slaves(1)
            .tomcats(1)
            .webApp(explodedWar, "ptrack")
            .catalinaOptsBuilder({builder, databasePrivateDnsName ->
                 builder.arg("-Xmx500m")
                 builder.prop("com.sun.management.jmxremote")
                 builder.prop("com.sun.management.jmxremote.port", 8091)
                 builder.prop("com.sun.management.jmxremote.authenticate",
                                     false)
                 builder.prop("com.sun.management.jmxremote.ssl", false)
                 builder.prop("ptrack.application.environment", "ec2")
                 builder.prop("log4j.configuration",
                               "log4j-minimal.properties")
                 builder.prop("jdbc.db.server", databasePrivateDnsName)})

    SimpleCluster cluster = new SimpleCluster(ec2, clusterSpec)

    cluster.loadTest("…/projecttrack/functionalTests/jmeter/SimpleTest.jmx",
        [1, 2])

    cluster.stop()
  }
}

Let’s look at each of the pieces.

First, we need to configure the framework as follows:

    AWSProperties awsProperties = new
        AWSProperties("/…/aws.properties")
    def ec2 = new EC2(awsProperties)

The aws.properties file contains various properties including the Amazon WS security credentials and the EC2 AMI (i.e. OS image) to launch. All servers use my EC2 appliance AMI that has Java, MySQL, Apache, Tomcat, Jmeter and some other useful tools pre-installed.

Next we need to configure the servers:

     ClusterSpec clusterSpec =
        new ClusterSpec()
             .schema("ptrack", ["ptrack": "ptrack"],
                    ["src/test/resources/testdml1.sql",
                     "src/test/resources/testdml2.sql"])
             .slaves(1)
             .tomcats(1)
             .webApp(explodedWar, "ptrack")
             .catalinaOptsBuilder({builder, databasePrivateDnsName ->
                 builder.arg("-Xmx500m")
                 builder.prop("com.sun.management.jmxremote")
                 builder.prop("com.sun.management.jmxremote.port", 8091)
                 builder.prop("com.sun.management.jmxremote.authenticate",
                                     false)
                 builder.prop("com.sun.management.jmxremote.ssl", false)
                 builder.prop("ptrack.application.environment", "ec2")
                 builder.prop("log4j.configuration",
                               "log4j-minimal.properties")
                 builder.prop("jdbc.db.server", databasePrivateDnsName)})

     SimpleCluster cluster = new SimpleCluster(ec2, clusterSpec)

This code first creates a ClusterSpec, which defines the configuration of the machines and the applications:

  • schema() – specifies the name of the database schema to create; names of the users and their passwords; the DML scripts to execute once the database has been create
  • slaves() – specifies how many MySql slaves to create
  • tomcats() – specifies how many Tomcats to run.
  • webApp() – configures a web application. This method takes two parameters: the path to the exploded WAR directory (conveniently created by Maven) and the context to deploy the web application under.
  • catalinaOptsBuilder() – supplies a closure that takes a builder and the DNS name of the MySQL server as arguments and returns the CATALINA_OPTS used to launch Tomcat. It’s primary purpose is to configure the web application(s) to use the correct database server

It then creates a cluster with that specification.

We then start the cluster:

    cluster.start()

At this point EC2Deploy will:

  1. Launch the EC2 instances running my appliance AMI.
  2. Initialize the MySql master database
  3. Create the MySql slave
  4. Create the database schema and the users
  5. Run any DML scripts (these are cached on S3 in a bucket called “tmp–dml” for the reasons described next)
  6. Upload the web applications to Amazon S3 (Simple Storage Service) where they are cached in order to avoid time consuming uploads (over slow DSL connections, for example). EC2Deploy only uploads new and changed files, which means that the bulky 3rd party libraries are only uploaded once. Each web application is stored in an S3 bucket called -tmp-war. If this bucket does not exist you will see some warning messages and the bucket will be created.
  7. Deploy the web applications on each of the Tomcat servers
  8. Configure Apache to load balance across the Tomcat servers

Once the cluster is started we can run a JMeter load test:

    cluster.loadTest("…/projecttrack/functionalTests/jmeter/SimpleTest.jmx", [1, 2])

The first argument specifies the test to run and the second argument is a list of JMeter thread counts. In this example, EC2deploy first runs the load test with one thread and then two threads. For each test run, it generates a report describing CPU utilization for each machine, average response time and throughput.

Finally, we stop the EC2 instances:

cluster.stop()

As you can see, EC2Deploy makes it pretty easy to deploy and test your enterprise Java application. I’ve used it to clone a production environment and run load tests. NOTE 1/28/08: The source code EC2Deploy along with a very cool Maven plugin is now available !

Tagged : / / / / / / / / / / / / / / / / / /

Jacksum – a java checksum utility – Introduction and usage

jacksum-introduction

Jacksum, a java checksum utility

Software Name : Jacksum

Website : http://jacksum.net/en/index.html

Version : 1.7.0

Jacksum is a platform independent checksum utility (written entirely in Java) for computing and verifying (integrity check) checksums, CRC and hashes (fingerprints). It supports 58 popular hash algorithms and a lot of unique features.

The Jacksum is a freeware tool and suitable for more advanced users verify checksum values. It is platform independent software (support Windows and Unix) and supports 58 popular standard algorithms (Adler32, BSD sum, Bzip2’s CRC-32, POSIX cksum, CRC-8, CRC-16, CRC-24, CRC-32 (FCS-32), CRC-64, ELF-32, eMule/eDonkey, FCS-16, GOST R 34.11-94, HAS-160, HAVAL (3/4/5 passes, 128/160/192/224/256 bits), MD2, MD4, MD5, MPEG-2’s CRC-32, RIPEMD-128, RIPEMD-160, RIPEMD-256, RIPEMD-320, SHA-0, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, Tiger-128, Tiger-160, Tiger, Tiger2, Tiger Tree Hash, Tiger2 Tree Hash, Unix System V sum, sum8, sum16, sum24, sum32, Whirlpool-0, Whirlpool-1, Whirlpool and xor8).
The Jacksum is written in Java and open source, we can download the source code and try to understand how Jacksum implement the above algorithm.
Use of Jacksum

  • Often time, while we downloading files or software via some secure website, “Checksum” values in MD5 or SHA1 format are provided to protect users from downloading corrupted files or trojan infected files. Unfortunately, many users has no idea how to verify the downloaded file with “Checksum” value, end up in downloading virus or trojan infected files.
  • With Jacksum you can check if a filetransfer was successful. If you download software or huge files, like CD-images (so called iso files) from the internet, often there is a checksum or a hashcode provided. With Jacksum you can calculate such a checksum or hashcode from your local copy. If both checksequences are identical you know that the filetransfer was successful.
  • As Jacksum supports recursively file processing, you can compare two directory trees. Therefore you will be able to verify, if your copies or backups are identical with the original source, even if you don’t have access to both trees at the same time (compare two DVDs with just one drive for example).
  • Jacksum can assist you if you want to perform an unidirectional sync of two directory trees, even if they are on two different computer without a connection in between.
    As Jacksum reads each byte of a file, you can check if all files are still readable on your CD-ROM or DVD.
  • As Jacksum supports a platform independent and compatible file format, it helps you to verify data integrity of burned data on CD-ROMs or DVDs even after many years and even if you will have changed your Operating System.
  • Jacksum can help you to create incremental backups. If you are a developer, Jacksum can help you to create patches for your customers.
  • You can use Jacksum for intrusion detection, because Jacksum can check whether and what files have been changed or deleted on your system. Jacksum can not only check the content of each file you want, but also the file timestamps.
  • Use Jacksum for website content change detection, so get informed if something has changed on your favorite website (can be useful if the website has no announcement-mail-alias).
  • This software is OSI Certified Open Source software
  • It is entirely free software (it runs on free platforms and therefore it is listed also at the Free
  • Software Foundation directory)
  • It is free of charge, it costs nothing
  • It is free of registration (well, I’m happy if you write an e-mail to jonelo@jonelo.de for feedback
  • It never expires
    Requirements:· JRE version 1.3.1 or later

Links:
http://manpages.ubuntu.com/manpages/jaunty/man1/jacksum.1.html
http://linux.softpedia.com/get/Utilities/Jacksum-7175.shtml
http://packages.ubuntu.com/lucid/jacksum
https://jacksum.dev.java.net/
http://www.jonelo.de/java/jacksum/
http://sourceforge.net/projects/jacksum/

Tagged : / / / / / / / / / / / / / / /

How to access all Java system properties directly?

java-system-properties

You could access all Java system properties directly via ${name}, e.g.

${user.name}, ${user.dir}, ${user.home}, …

You could read environment properties and use them

  <properties environment=”env”/>

  ${env.ENVIRONMENT_VARIABLE}

e.g.

  ${env.USERPROFILE}, ${env.USERNAME}, ${env.PATH}

You could pass properties during Ants start

  ant -Dname=value -Danothername=anothervalue

Also you Ant could ask for input

  <input addproperty=”foo”/>

  ${foo}

Tagged : / / / / / / / / / / / / / / / / /