Package: openjdk-6-jdk Version: 6b11-9.1+lenny2 Severity: normal File: /usr/lib/jvm/java-6-openjdk/bin/javac
Specifically, compiling with -source 1.5 does not produce class files compatible with a 1.5 jvm. Compiling with -target 1.5 does. >From javac(1): "The default for -target depends on the value of -source: [...] For all other values of -source, the value of -target is the value of -source." Reproduction steps: $ javac -source 1.5 HelloWorld.java $ javap -verbose HelloWorld | fgrep 'major version:' major version: 50 $ javac -target 1.5 HelloWorld.java $ javap -verbose HelloWorld | fgrep 'major version:' major version: 49 >From the documentation, (and apparently from the Java Specification, but I haven't looked that up personally), we would expect both compilations to produce class files with major version 49. -- System Information: Debian Release: 5.0.3 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.26-2-686 (SMP w/4 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages openjdk-6-jdk depends on: ii dpkg 1.14.25 Debian package management system ii libc6 2.7-18 GNU C Library: Shared libraries ii libx11-6 2:1.1.5-2 X11 client-side library ii openjdk-6-jre 6b11-9.1+lenny2 OpenJDK Java runtime, using Hotspo ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime Versions of packages openjdk-6-jdk recommends: pn libxt-dev <none> (no description available) Versions of packages openjdk-6-jdk suggests: pn openjdk-6-demo <none> (no description available) pn openjdk-6-source <none> (no description available) -- no debconf information
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } }