Package: sun-java6-jre
Version: 6-07-4
Severity: normal

Hi,

It seems as if the latest version of the JRE ignores the -classpath.

folk...@mauer:~$ java -classpath /usr/share/java/mysql-connector-java-5.1.6.jar 
 -jar testmysql.jar
exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Library path: 
/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/../lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib

if -classpath expects a path, it doesn't work either:

folk...@mauer:~$ java -classpath /usr/share/java  -jar testmysql.jar
exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Library path: 
/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/../lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib

testmysql.java:
--------------
import java.util.*;
import java.sql.*;

class testmysql
{
        static public void main(String [] args)
        {
                try
                {
                        Class.forName("com.mysql.jdbc.Driver");

                        System.out.println("  mysql connect");
                        Connection con = 
DriverManager.getConnection("jdbc:mysql://mauer:3306/posbook", "pos", "pospw");
                        System.out.println("  mysql connected!");

                        String query = "SELECT (avg(white) + avg(black)) / 2.0 
AS scaler FROM book";
                        Statement stmt = 
con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
ResultSet.CONCUR_READ_ONLY);
                        ResultSet rs = stmt.executeQuery(query);
                        if (rs.next())
                                System.out.println("result: " + 
rs.getDouble("scaler"));
                        else
                                System.out.println("nothing returned");
                }
                catch(Exception e)
                {
                        System.out.println("exception: " + e);
                        System.out.println("Library path: " + 
System.getProperty("java.library.path"));
                }
        }
}

testmysql-manifest.txt:
----------------------
Main-Class: testmysql

jar creation commandline:
------------------------
jar cmf testmysql-manifest.txt testmysql.jar testmysql.class


-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages sun-java6-jre depends on:
ii  debconf [debconf-2.0]         1.5.24     Debian configuration management sy
ii  java-common                   0.30       Base of all Java packages
ii  locales                       2.7-16     GNU C Library: National Language (
ii  sun-java6-bin                 6-07-4     Sun Java(TM) Runtime Environment (

Versions of packages sun-java6-jre recommends:
pn  gsfonts-x11                   <none>     (no description available)

Versions of packages sun-java6-jre suggests:
pn  sun-java6-fonts               <none>     (no description available)
pn  sun-java6-plugin | ia32-sun-j <none>     (no description available)
pn  ttf-arphic-uming              <none>     (no description available)
pn  ttf-baekmuk | ttf-unfonts | t <none>     (no description available)
pn  ttf-kochi-gothic | ttf-sazana <none>     (no description available)
pn  ttf-kochi-mincho | ttf-sazana <none>     (no description available)

-- debconf information:
  sun-java6-jre/stopthread: true
* shared/accepted-sun-dlj-v1-1: true
  sun-java6-jre/jcepolicy:
  shared/error-sun-dlj-v1-1:
* shared/present-sun-dlj-v1-1:



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to