Git Product home page Git Product logo

jarlint's Introduction

JARLINT!

Overview

Jarlint is a pretty basic Perl script that will look at your Java classpath, and look for the following:

  • elements that don't exist in the filesystem
  • duplicate elements (same path, more than once)
  • binary duplicates (different paths, same bits)
  • worrisome duplicates (same filename, different bits, different paths -- uh-oh!)
  • multiple versions (a fuzzy match that'll look for e.g. foo.jar and foo-1.2.jar)

After trolling through your system, jarlint will produce a report that outlines what it found, what's a problem, and why. And it's marked up with markdown so it's readable as-is, but can also be easily prettied up with HTML conversion and CSS if you want to use it in a more formal setting.

Much as I'd like to write this in something more fun, Perl is pretty reliably going to be on any box, and Java is too much of an arse-ache.

Dependencies

You'll need to have the Digest::MD5 Perl module installed. That's pretty standard, though. To confirm that you have it, do this from the command line:

perl -MDigest::MD5

If nothing happens, you're good (hit ctrl-d to get on with things). If you get an error message, you're not good, and you'll need to get the module installed.

Installation

In the directory where you'd like to keep the jarlint script, run these two commands:

curl -fsSL https://raw.github.com/lglenn/Jarlint/master/jarlint > jarlint

chmod a+x jarlint

Or:

Running jarlint

The script will look in the following places for the classpath, in this order:

  1. A file with the name of the first parameter from the command line.
  2. The first parameter from the command line.
  3. The CLASSPATH environment variable.

Jarlint can read two kinds of files: text files that contain a CLASSPATH Unix-style environment variable declaration, and Blue Martini log files. In each case, jarlint will read the file until it finds the classpath, and then close it. It won't, for example, read all of a 2-gig Blue Martini log file.

If the classpath contains relative paths (e.g. './lib/foo.jar'), make sure that you run jarlint from someplace where those paths will resolve correctly.

Examples:

Pass the classpath on the command line:

jarlint ./classes:./lib/foo.jar:./lib/bar.jar

Pass a filename on the command line:

jarlint classpath.txt

Pass the name of a Blue Martini log on the command line:

jarlint website.log

Use the environment:

export CLASSPATH=lib/foo.jar:lib/bar.jar:classes
jarlint

jarlint's People

Contributors

lglenn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.