Skip to content

Commit f89af67

Browse files
committed
Completet the readme and adapted gitignore for gradle / eclipse project
1 parent fb6ac06 commit f89af67

File tree

2 files changed

+70
-7
lines changed

2 files changed

+70
-7
lines changed

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
*.class
2-
3-
# Package Files #
4-
*.jar
5-
*.war
6-
*.ear
1+
# ignores for gradle/eclipse builds #
2+
build
3+
.gradle
4+
bin
5+
.classpath
6+
.settings

README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,67 @@
11
classversion-scanner
22
====================
33

4-
Tool that scans compiled Java .class files and reports the java runtime version they're targeted at. Supports filtering for min and max java runtime version and traverses directories and archives recursively.
4+
Tool that scans compiled Java .class files and reports the java runtime version they're targeted at. Supports
5+
filtering for min and max java runtime version and traverses directories and archives recursively.
6+
7+
This might be useful if you're running on an older Java runtime and are getting the well-known error message:
8+
9+
java.lang.UnsupportedClassVersionError: Bad version number in .class file
10+
11+
This error might come without any hint at the class, the archive it was loaded from, or even a stack trace.
12+
If you face this issue, you can use this tool and point it at the root of your application (you can even
13+
point it at the root of your JEE application server or servlet container to scan the whole thing) and
14+
tell it to look for class files thare are newer than your target java runtime.
15+
16+
17+
Building
18+
--------
19+
20+
You'll need any Java6+ JDK and gradle to build. If you have both installed, just run the following in the root
21+
directory of your checkout:
22+
23+
classversion-scanner$ gradle install
24+
25+
There will be a ready-to-use installation in `build/install/classversion-scanner/` you can launch the tool by
26+
executing `build/install/classversion-scanner/bin/classversion-scanner`.
27+
28+
29+
Usage
30+
-----
31+
32+
classversion-scanner$ build/install/classversion-scanner/bin/classversion-scanner --help
33+
34+
usage: com.netmikey.cvscanner.ClassVersionScanner
35+
-d,--dir <arg> the root directory from which to search for class
36+
files and java archives (if not set, the current
37+
working directory will be used).
38+
-h,--help display this help info
39+
-n,--newer <arg> only look for class files compiled for the specified
40+
JRE and newer
41+
-o,--older <arg> only look for class files compiled for the specified
42+
JRE and older
43+
-v,--verbose display more processing info
44+
45+
46+
Example
47+
-------
48+
49+
Find all class files in the tool's own installation directory compiled for Java6 or newer:
50+
51+
build/install/classversion-scanner$ bin/classversion-scanner --newer 6
52+
53+
30.08.2012 13:57:47 com.netmikey.cvscanner.Scanner processClassFile
54+
INFO: Found matching class file: classversion-scanner/build/install/classversion-scanner/lib/classversion-scanner.jar/com/netmikey/cvscanner/ClassVersionScanner.class compiled for Java version: 6
55+
30.08.2012 13:57:47 com.netmikey.cvscanner.Scanner processClassFile
56+
INFO: Found matching class file: classversion-scanner/build/install/classversion-scanner/lib/classversion-scanner.jar/com/netmikey/cvscanner/JavaVersion.class compiled for Java version: 6
57+
30.08.2012 13:57:47 com.netmikey.cvscanner.Scanner processClassFile
58+
INFO: Found matching class file: classversion-scanner/build/install/classversion-scanner/lib/classversion-scanner.jar/com/netmikey/cvscanner/Scanner$1.class compiled for Java version: 6
59+
30.08.2012 13:57:47 com.netmikey.cvscanner.Scanner processClassFile
60+
INFO: Found matching class file: classversion-scanner/build/install/classversion-scanner/lib/classversion-scanner.jar/com/netmikey/cvscanner/Scanner$2.class compiled for Java version: 6
61+
30.08.2012 13:57:47 com.netmikey.cvscanner.Scanner processClassFile
62+
INFO: Found matching class file: classversion-scanner/build/install/classversion-scanner/lib/classversion-scanner.jar/com/netmikey/cvscanner/Scanner$3.class compiled for Java version: 6
63+
30.08.2012 13:57:47 com.netmikey.cvscanner.Scanner processClassFile
64+
INFO: Found matching class file: classversion-scanner/build/install/classversion-scanner/lib/classversion-scanner.jar/com/netmikey/cvscanner/Scanner$4.class compiled for Java version: 6
65+
30.08.2012 13:57:47 com.netmikey.cvscanner.Scanner processClassFile
66+
INFO: Found matching class file: classversion-scanner/build/install/classversion-scanner/lib/classversion-scanner.jar/com/netmikey/cvscanner/Scanner.class compiled for Java version: 6
67+

0 commit comments

Comments
 (0)