Classpath


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Classpath

  1. #1
    Daniel Guest

    Classpath


    Hi,
    When I tried to run a class file, an error msg would appear :

    Unable to locate system class : system/lang/String

    Could someone teach me how to set the classpath ??
    I am using Win95. Tks


  2. #2
    John Harris Guest

    Re: Classpath


    "Daniel" wrote:
    >
    >Hi,
    > When I tried to run a class file, an error msg would appear :
    >
    > Unable to locate system class : system/lang/String
    >
    >Could someone teach me how to set the classpath ??
    >I am using Win95. Tks
    >

    Hi, I'm John.
    I've been fighting the Classpath battle myself. I bought JBuilder2 and took
    the Classpath they set up as a starting Point, but I branched off to do bare-bones
    Java (using "java", "javac", "javadoc", etc.) I've got a production environment
    and a development environment, so my packages start within the corresponding
    libraries. I experimented to see what was the minimum, so here's mine:

    -classpath .;..\STAPLES\rt.jar

    The 'rt.jar' is possibly what you're missing. I copied mine from the JBuilder2
    location to my directory "STAPLES".

    The "." is for getting to other classes of my own. I've got them stored
    under "package"s, as recommended. I use the "import" command to get javac
    into those libraries. The ".." gets me out of the "production" or "development"
    library (to the "D:\java" library), and the rest gets me to D:\java\STAPLES\rt.jar.

    Since I want to keep my original (JBuilder2) path the same, I build .bat
    files to compile and run, applying the above switch to the 'java' and 'javac'
    commands. If you want to make yours universal, you can try it first, by
    entering

    SET CLASSPATH= (...)

    and then trying your commands. When all works, put the same statement in
    your c:\autoexec.bat file.

    I hope this has helped. I'm a bit of a newbie myself.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center