How to add to classpath using 'java -cp' in SunOS 8.5?

Ask a Question related to Sun Solaris, Design and Development.

  1. #1

    Default How to add to classpath using 'java -cp' in SunOS 8.5?

    I have not used Unix in a LONG time, so pardon the seemingly stupid
    question.

    I need to add a .jar file to my java.class.path (classpath), using the
    'java -cp' command preferably.

    When I attempt to do so, my classpath does not change and there is no
    error in the console other than it displaying the proper syntax for a
    'java -cp' statement.

    Here is what I enter:
    java -cp /saba/myCompany/SabaWeb/lib/custom.jar

    What am I doing wrong? I have alternatively tried setting the
    $CLASSPATH env variable, but that does not work either.

    Any help is appreciated.

    Mike
    Seattle
    Michael Brophy Guest

  2. Similar Questions and Discussions

    1. no such classpath element
      I am getting this error everytime I restart my Coldfusion MX 7.0.1 server. no such classpath element: D:\CFusionMX7\runtime/../../classes Any...
    2. actionscript-Classpath
      Hi, i try to compile my App and the following error appears: 2 A file found in an actionscript-classpath must have an externally visible...
    3. ColdFusion Classpath
      We installed ColdFusion MX 7 Multi-Server option and we want to add a Java CFX custom classpath to the CF administrator. In the past w/o...
    4. CFMX7 Classpath
      Can someone please help me with this problem? I have some class and jar files that worked when I drop them in the WEB-INF folder of my standalone...
    5. Java classpath not reloading new class file
      I set up a classpath in the Administration page to a directory that contains all my .class files. I can access the methods through Coldfusion...
  3. #2

    Default Re: How to add to classpath using 'java -cp' in SunOS 8.5?

    [email]m_brophy@hotmail.com[/email] (Michael Brophy) wrote in message news:<3d63b0eb.0307260007.6643c7c1@posting.google. com>...
    > I have not used Unix in a LONG time, so pardon the seemingly stupid
    > question.
    >
    > I need to add a .jar file to my java.class.path (classpath), using the
    > 'java -cp' command preferably.
    >
    > When I attempt to do so, my classpath does not change and there is no
    > error in the console other than it displaying the proper syntax for a
    > 'java -cp' statement.
    >
    > Here is what I enter:
    > java -cp /saba/myCompany/SabaWeb/lib/custom.jar
    >
    > What am I doing wrong? I have alternatively tried setting the
    > $CLASSPATH env variable, but that does not work either.
    >
    > Any help is appreciated.
    >
    > Mike
    > Seattle
    My understanding: -cp is an option, you need to specify a class to
    execute (or use -jar to specify a jar file to execute). Also -cp
    only modifies the classpath for that java process (you might be
    thinking it persistently registers or stores a new classpath).

    If your wished the class to execute (suppose: HelloWorld) to be found
    in the current dir, then it would not be found anymore without
    something like:

    java -cp .:/saba/myCompany/SabaWeb/lib/custom.jar HelloWorld

    --
    Early warning sign #104:
    Bonobo chimps around the world are mysteriously disappearing.
    Indicates:
    A megalomaniac dictator is finally initiating research to develop a
    hybrid human and bonobo chimp super-soldier.
    reb@cypress.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139