Length limit on CLASSPATH setting (JIntegra's regjvmcmd)

Discussion in 'Java' started by Prabh, May 18, 2004.

  1. Prabh

    Prabh Guest

    Hello all,
    When running cmds which set the CLASSPATH on WIN, is there any
    upper-limit on the length of the CLASSPATH value string?

    From WIN XP, I'm running JIntegra's regjvmcmd as follows,

    ==============================================================================
    regjvmcmd /native /inproc /java2 Foojvm
    classpath="C:\Progra~1\AppFolder\lib\First.jar
    ....<whole-bunch-of-jars>" jvm="c:\program
    files\java\j2re1.4.2\bin\client\jvm.dll"
    main=com.jintegra.setup.MainClass -Djintegra.jvm=Foojvm
    -DJINTEGRA_NATIVE_MODE
    ==============================================================================

    When the CLASSPATH is reasonably short the regjvmcmd works fine, but
    when its really long, I dont see the CLASSPATH set for the FooJVM.

    Could anyone give me some pointers, please?
    Is this related more to Windows?

    Thanks,
    Prabh
     
    Prabh, May 18, 2004
    #1
    1. Advertising

  2. Prabh

    Ken Kafieh Guest

    I can tell you that I have personally seen the value of CLASSPATH and other
    environment variables truncated.
    You may be forced to either shorten paths, or choose between the most
    important paths. At least, thats what I did
    another thing you may want to do is get rid of the LFNs and convert the path
    names to 8Dot3 format. For example, use

    C:\PROGRA~1

    instead of

    "C:\PROGRAM FILES"

    -Ken


    "Prabh" <> wrote in message
    news:...
    > Hello all,
    > When running cmds which set the CLASSPATH on WIN, is there any
    > upper-limit on the length of the CLASSPATH value string?
    >
    > From WIN XP, I'm running JIntegra's regjvmcmd as follows,
    >
    >

    ============================================================================
    ==
    > regjvmcmd /native /inproc /java2 Foojvm
    > classpath="C:\Progra~1\AppFolder\lib\First.jar
    > ...<whole-bunch-of-jars>" jvm="c:\program
    > files\java\j2re1.4.2\bin\client\jvm.dll"
    > main=com.jintegra.setup.MainClass -Djintegra.jvm=Foojvm
    > -DJINTEGRA_NATIVE_MODE
    >

    ============================================================================
    ==
    >
    > When the CLASSPATH is reasonably short the regjvmcmd works fine, but
    > when its really long, I dont see the CLASSPATH set for the FooJVM.
    >
    > Could anyone give me some pointers, please?
    > Is this related more to Windows?
    >
    > Thanks,
    > Prabh
     
    Ken Kafieh, May 18, 2004
    #2
    1. Advertising

  3. Prabh

    Tony Morris Guest

    > When the CLASSPATH is reasonably short the regjvmcmd works fine, but
    > when its really long, I dont see the CLASSPATH set for the FooJVM.
    >
    > Could anyone give me some pointers, please?
    > Is this related more to Windows?


    Yes there is a limit to the length of the CLASSPATH, since there is a limit
    to the length of an executable command on Windows.
    I've encountered this limit before (by attempting to set a long CLASPATH),
    but I couldn't tell you exactly what it is (Google prolly will).

    --
    Tony Morris
    (BInfTech, Cert 3 I.T.)
    Software Engineer
    (2003 VTR1000F)
    Sun Certified Programmer for the Java 2 Platform (1.4)
    Sun Certified Developer for the Java 2 Platform
     
    Tony Morris, May 18, 2004
    #3
  4. Prabh

    Roedy Green Guest

    On 17 May 2004 17:22:24 -0700, (Prabh) wrote or
    quoted :

    >When running cmds which set the CLASSPATH on WIN, is there any
    >upper-limit on the length of the CLASSPATH value string?


    IIRC Win98 has a limit of 255. It may be higher for other or 4NT.

    You can pare in down by putting jars in the ext directory.

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

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, May 18, 2004
    #4
  5. Prabh

    Prabh Guest

    Roedy Green <> wrote in message news:<>...
    > On 17 May 2004 17:22:24 -0700, (Prabh) wrote or
    > quoted :
    >
    > >When running cmds which set the CLASSPATH on WIN, is there any
    > >upper-limit on the length of the CLASSPATH value string?

    >
    > IIRC Win98 has a limit of 255. It may be higher for other or 4NT.
    >
    > You can pare in down by putting jars in the ext directory.
    >
    > see http://mindprod.com/jgloss/classpath.html





    Thanks a lot everybody for your responses.

    I do have a question with the ext directory approach, however.
    If I understand the ext mechanism right, I'd need to install all my
    jars in <JRE>\lib\ext location of user's PC.

    1. Would it not be an issue if there are two jars with identical name?

    2. I guess, I could make an effort not to install two
    identically-named jars, but what if the user installs some other
    product which too installs to
    the ext dir and has a similarly named jar as mine.

    Thanks,
    Prab
     
    Prabh, May 18, 2004
    #5
  6. Prabh

    Liz Guest

    my classpath is 890 characters long on windows xp

    "Roedy Green" <> wrote in message
    news:...
    > On 17 May 2004 17:22:24 -0700, (Prabh) wrote or
    > quoted :
    >
    > >When running cmds which set the CLASSPATH on WIN, is there any
    > >upper-limit on the length of the CLASSPATH value string?

    >
    > IIRC Win98 has a limit of 255. It may be higher for other or 4NT.
    >
    > You can pare in down by putting jars in the ext directory.
    >
    > see http://mindprod.com/jgloss/classpath.html
    >
    > --
    > Canadian Mind Products, Roedy Green.
    > Coaching, problem solving, economical contract programming.
    > See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Liz, May 18, 2004
    #6
  7. Prabh schrieb:
    [...]

    > I do have a question with the ext directory approach, however.
    > If I understand the ext mechanism right, I'd need to install all my
    > jars in <JRE>\lib\ext location of user's PC.


    Don't put files into the ext directory.

    IMO, the ext directory is superfluous and makes more problems than it
    solves.

    >
    > 1. Would it not be an issue if there are two jars with identical name?


    You cannot have two files with identical name within the same directory.

    >
    > 2. I guess, I could make an effort not to install two
    > identically-named jars, but what if the user installs some other
    > product which too installs to
    > the ext dir and has a similarly named jar as mine.


    Then, yours is gone.

    But there are a more problems with the ext directory. Assume you have
    two applications and both use the same library, called NeededLib. The
    first application relies on version 1.3, the second on version 2. And now?

    Of course, you can rename the files, e.g. to neededlib1_3.jar and
    neededlib2.jar. But both jars contains (more or less) the same classes.
    And now?

    Perhaps one can solve these ambiguities using versioning information
    (this requires that the package includes versioning information).

    And now? Now, you've dealt with many problems and you've done a lot of
    work, just because one wanted to see his jar inside the ext directory.

    Bye
    Michael
     
    Michael Rauscher, May 19, 2004
    #7
  8. Prabh

    Roedy Green Guest

    On 18 May 2004 09:44:27 -0700, (Prabh) wrote or
    quoted :

    >I do have a question with the ext directory approach, however.
    >If I understand the ext mechanism right, I'd need to install all my
    >jars in <JRE>\lib\ext location of user's PC.
    >
    >1. Would it not be an issue if there are two jars with identical name?
    >
    >2. I guess, I could make an effort not to install two
    >identically-named jars, but what if the user installs some other
    >product which too installs to
    >the ext dir and has a similarly named jar as mine.


    There are two ext directories. I put them in both. I use a bat file
    like this every time I change JVMs.


    rem fixext.btm fix the ext directories for Java

    @echo off
    set target1="E:\j2sdk1.4.2_04\jre\lib\ext"
    set target2="C:\Program Files\Java\j2re1.4.2_04\lib\ext"
    set
    echo.
    echo Check that sets look plausible
    pause
    rem 4NT requires ( and ) to be on different lines than contents, Note
    no & and no \
    for %target in ( %target1 %target2 ) do (

    cdd %target

    copy "C:\Program Files\JMF2.1.1e\lib\jmf.jar"
    copy "C:\Program Files\JMF2.1.1e\lib\sound.jar"
    copy "C:\jaf-1.0.2\activation.jar"
    copy "C:\javamail-1.3\mail.jar"
    copy "E:\j2sdk1.4.2_04\jre\javaws\javaws.jar"
    )
    echo.
    echo check that copies all worked.
    pause

    echo.
    echo.
    echo jikespath should be:
    echo e:\j2sdk1.4.2_04\jre\lib\rt.jar;.;C:\;E:\;C:\Program
    Files\JMF2.1.1e\lib;C:\WINNT\java\classes
    echo.
    echo it is:
    echo %Jikespath%
    echo.
    echo.
    echo classpath should be:
    echo .;C:\;E:\;C:\Program Files\JMF2.1.1e\lib;C:\WINNT\java\classes
    echo.
    echo it is
    echo %classpath%
    echo.
    echo.
    echo path should be:
    echo
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;E:\Program
    Files\Panda Software\Panda Antivirus
    Platinum;E:\JET\bin;E:\VSLICK\WIN;e:\J2SDK1.4.2_04\BIN;C:\env;c:\bat\;c:\sys;C:\Program
    Files\Common Files\Adaptec Shared\System
    echo E:\Program Files\Microsoft Visual
    Studio\Common\Tools\WinNT;E:\Program Files\Microsoft Visual
    Studio\Common\MSDev98\Bin;E:\Program Files\Microsoft Visual
    Studio\Common\Tools;E:\Program Files\Microsoft Visual Studio\VC98\bin
    echo.
    echo it is:
    echo %path%
    pause

    rem -30-




    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, May 19, 2004
    #8
  9. Prabh

    Roedy Green Guest

    On 18 May 2004 09:44:27 -0700, (Prabh) wrote or
    quoted :

    >1. Would it not be an issue if there are two jars with identical name?


    Just rename one jar. The java does not care about the jar name, only
    the class name.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, May 19, 2004
    #9
  10. Prabh

    Roedy Green Guest

    On 18 May 2004 09:44:27 -0700, (Prabh) wrote or
    quoted :

    >2. I guess, I could make an effort not to install two
    >identically-named jars, but what if the user installs some other
    >product which too installs to
    >the ext dir and has a similarly named jar as mine.


    Generally products don't change your ext directory without your
    permission. They usually fiddle the classpath. It is up to you to undo
    the classpath fiddle and copy the jar files.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, May 19, 2004
    #10
  11. Prabh

    Real Gagnon Guest

    "Liz" <> wrote in news:79wqc.2489$zw.1921@attbi_s01:

    > my classpath is 890 characters long on windows xp


    The OP problem is not really the classpath length but the command line
    length which is limited to 255 characters.

    Bye.
    --
    Real Gagnon from Quebec, Canada
    * Looking for Java or PB snippets ? Visit Real's How-to
    * http://www.rgagnon.com/howto.html
     
    Real Gagnon, May 19, 2004
    #11
  12. Prabh

    Liz Guest

    I put mine in a batch file as a single line and
    that works ok.

    "Real Gagnon" <realgagnon_@_yahooSpamIsBadSstripunderscore.com> wrote in
    message news:Xns94EDE408FB20Drealhowtowwwrgagnonc@140.99.99.130...
    > "Liz" <> wrote in news:79wqc.2489$zw.1921@attbi_s01:
    >
    > > my classpath is 890 characters long on windows xp

    >
    > The OP problem is not really the classpath length but the command line
    > length which is limited to 255 characters.
    >
    > Bye.
    > --
    > Real Gagnon from Quebec, Canada
    > * Looking for Java or PB snippets ? Visit Real's How-to
    > * http://www.rgagnon.com/howto.html
     
    Liz, May 19, 2004
    #12
    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. Frederik Van Lierde

    JVM crash using jintegra and IE6.0

    Frederik Van Lierde, Jul 30, 2004, in forum: Java
    Replies:
    1
    Views:
    423
    David Hopwood
    Aug 1, 2004
  2. Heba

    Jintegra/Excel Problem

    Heba, Oct 14, 2004, in forum: Java
    Replies:
    2
    Views:
    1,296
    Stian Bakken
    Oct 15, 2004
  3. JIntegra Problems

    , Jan 24, 2005, in forum: Java
    Replies:
    1
    Views:
    488
    Andrew Thompson
    Jan 25, 2005
  4. Support JIntegra

    , Jan 25, 2005, in forum: Java
    Replies:
    0
    Views:
    415
  5. Frederik Van Lierde

    JVM crash using jintegra and IE6.0

    Frederik Van Lierde, Jul 30, 2004, in forum: Javascript
    Replies:
    0
    Views:
    106
    Frederik Van Lierde
    Jul 30, 2004
Loading...

Share This Page