java -cp a.jar -jar b.jar => Works on Windows, not on Debian

Discussion in 'Java' started by cyberco, Feb 13, 2006.

  1. cyberco

    cyberco Guest

    OK, I feel like a complete newbie posting this, but this has baffeled
    me completely. I tried to execute the following:

    java -cp a.jar -jar b.jar

    Of course b.jar requires a.jar to run and both jars are in the same
    directory. It worked on windows but not on Debian. I've checked a
    million times that a.jar could be found by Debian (tried absolute
    paths, relative paths, exported classpath env. variables, path env.
    variables etc etc).

    What could explain the difference between Windows and Debian? Are jars
    treated differently on both platforms? Is it something in the manifest?
    cyberco, Feb 13, 2006
    #1
    1. Advertising

  2. cyberco

    cyberco Guest

    Well......found the answer here:

    http://mindprod.com/jgloss/jar.html#CLASSPATH

    Qoute:
    "If you use -jar on the java.exe command line, java.exe will quietly
    ignore the set environment classpath and any -classpath or -cp command
    line options."

    See the page for details how to solve this issue.

    Thanks, Rudy!
    cyberco, Feb 13, 2006
    #2
    1. Advertising

  3. cyberco

    Roedy Green Guest

    On 13 Feb 2006 13:41:58 -0800, "cyberco" <> wrote,
    quoted or indirectly quoted someone who said :

    >What could explain the difference between Windows and Debian? Are jars
    >treated differently on both platforms? Is it something in the manifest?


    what is the current directory in either case relative to where the
    jars live?
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Feb 13, 2006
    #3
  4. cyberco

    pwt Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    I don't know why it works on one OS but not another, but you may as
    well do this anyway.

    java -cp a.jar;b.jar SomeClassNameInsideOneOfTheJars

    -----BEGIN PGP SIGNATURE-----
    Version: PGP 8.0.2 - not licensed for commercial use: www.pgp.com

    iQIVAwUBQ/FPfEJUpdbmcyFBAQJcdxAAiSf78YecfRJ1AMHSKPMyLlgw9NtSICWn
    kCMP8AWczfQJUVt7ckk5+ozKe0JwyI86khuxBvN6NMhUaNblyDzmPMbJrrG3laqT
    0Jvpyi2e6nOIXST2lbl8M3ieNCDfb0D+tP2w+8MmzkYvSZYrP/nI7XZJIwq9/ubu
    qh3ZH1onWG71XIZjMY8b6Zy3dVwiv610gFVXerhSI+A2Z6dzR3opZclB6IS9m8fH
    J3hQvQM23+wcMcflcsxwqmtw8TehsC393jPTv79nfOVESuGxWcauZDWJdbPs0/82
    OMTGNnOA93YyiYJ5U+koAzzKcGa1W00mNH3YMkyw8JevU0UT7vRtHjlJ+OeEm0ry
    3fpA41QKExhi0Zls94SA7g6sa1gC3njRvZpOx1fvSynxn/GrPevBONnp5ahaJzfi
    oViKhETbLutjE/yZ+n6pKtU5YJOgFWTfNtgv8FPJ0+u/Vb7Llr0K4hc//gj2XI+6
    8Q92xttp8drHgXTVB84NrIk6lWfcZR83EcZ8xxr9jeJqRS3Ltv0DymheKTR1ycXh
    4ew0yR67bjR/GKdHXhQ2GD7bd1ltg0iQIKsy63RSP7CTmO7PfIKWdPcGRo+7A9FM
    60mKC4h7eLouvbwQ3YaprCXZVAUjgDOOGZX+S+KhN+qKho0AUth+7k0aljuYow8r
    fIYUBaAvLHw=
    =n8TD
    -----END PGP SIGNATURE-----
    pwt, Feb 14, 2006
    #4
  5. cyberco

    Roedy Green Guest

    On 13 Feb 2006 13:58:42 -0800, "cyberco" <> wrote,
    quoted or indirectly quoted someone who said :

    >Qoute:
    >"If you use -jar on the java.exe command line, java.exe will quietly
    >ignore the set environment classpath and any -classpath or -cp command
    >line options."
    >
    >See the page for details how to solve this issue.


    see http://mindprod.com/jgloss/classpath.html#GOTCHAS

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Feb 14, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    555
    Arnold Peters
    Jan 5, 2005
  2. F. GEIGER
    Replies:
    3
    Views:
    756
    F. GEIGER
    Aug 6, 2004
  3. Luke Kenneth Casson Leighton
    Replies:
    0
    Views:
    456
    Luke Kenneth Casson Leighton
    Dec 31, 2008
  4. Alexander Burger

    getMethod() works and works not

    Alexander Burger, Nov 27, 2010, in forum: Java
    Replies:
    25
    Views:
    1,722
    Alexander Burger
    Nov 29, 2010
  5. abargaddon
    Replies:
    1
    Views:
    187
    clintmazur
    Feb 4, 2008
Loading...

Share This Page