Setting up The CLASSPATH

I am trying to start my own package, however there was no classpath varable by default in the windows 2000 environment variables, I therefore created a user classpath variable and put the location of my package as a path, i have however had no success can anyone please offer me some help
Thanx

Here's some info on setting the classpath: http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html
This is how you set the classpath in Windows 2000: right click My Computer, select Properties, select Advanced, Environment Variables. Click New to create a new variable. Enter CLASSPATH as the name of the variable and a list of directories separated by semi-colons as the value. Click, OK, OK.
Note: You must close and re-open your command prompt window after adding or modifying environment variables.
After re-opening the command prompt window type: echo %CLASSPATH% to see how your classpath is currently set.
About classpath and packages: Suppose your class in in package com.mycompany.mypackage and suppose your class files are in the directory C:\stuff\com\mycompany\mypackage. In that case you would have to set your classpath to C:\stuff (i.e., the base directory of your package).
If you get any error messages, please copy and paste them here.
Jesper

Similar Messages

  • Set up the classpath for tomcat 5.0 to compile servlet

    I am totally confused how do you set up the class path, i use this command:
    c:\set CLASSPATH=.;C:\tomcat5.0\common\lib\servlet-api.jar;%CLASSPATH%
    and I compile my file which i put in j2sdk1.4.2_10\bin
    here is the command line:
    c:\j2sdk1.4.2_10\bin\servletexercise1.java
    and it gives me the error message to say that it can't find the servelt, javax.servlet.
    Please help! thanks in advance!

    I am totally confused how do you set up the class
    path, i use this command:
    c:\set
    CLASSPATH=.;C:\tomcat5.0\common\lib\servlet-api.jar;%C
    LASSPATH%I don't have a CLASSPATH environment variable on any machine that I work with.
    and I compile my file which i put in j2sdk1.4.2_10\binThat's a pretty stoopid place to put a Java source file. You shouldn't be putting any files in that directory.
    The right thing to do is to add the Java /bin directory to your PATH environment variable. When you do, make sure there are no spaces in the path name. (e.g., don't install Java to the "Program Files" directory) OR replace it with its 8-char DOS equivalent (e.g., c:\Progra~1).
    here is the command line:
    c:\j2sdk1.4.2_10\bin\servletexercise1.javaSorry, I don't see where you execute javac.exe.
    and it gives me the error message to say that it
    can't find the servelt, javax.servlet.
    Please help! thanks in advance!What is this telling you? That the javac.exe totally ignores the CLASSPATH that you set? (Hint: Right answer.)
    The correct way to do it is to use the -classpath option on javac.exe.
    %

  • How to set up the -classpath in javadoc

    Hiya,
    I have used Runtime.exec() to execute javadoc. The problem is with the classpath coz i keep getting "No source files for package pkgnmxxx.clsnamexxx"
    My doclet class resides in the following folder:
    f:\projects\dsim\SExecutive\DiscoverClasses.java
    and is the part of package called SExecutive.
    My target classes that needs to be documented reside in
    f:\projects\dsim\model\ATMqLen\Atmqlen.java
    and is the part of package called "ATMqLen". This file "Atmqlen.java" contains classes that are not public or protected and their need not have the same name as the file itself.
    Even the java statement at the dos prompt wont work
    the statement is as follows:
    F:\> javadoc -private -doclet SExecutive.DiscoverClasses -docletpath f:\projects\dsim\SExecutive\ -sourcepath f:\projects\dsim\SExecutive;.f:\projects\dsim\model\ATMqLen\ ATMqLen.Atmqlen.java
    F:\>_
    It generates following output
    Loading source files for package ATMqLen.Atmqlen.java......
    javadoc: Warning -No source files for package Atmqlen.java
    Constructing javadoc information.......
    javadoc: Warning -No source files for package Atmqlen.java
    2 warnings
    What am i doing wrong. I think if i can get it to work at dos prompt than it would be easy to get the Runtime.exec() working.
    Thanks
    Derik.

    My doclet class resides in the following folder:
    f:\projects\dsim\SExecutive\DiscoverClasses.java
    and is the part of package called SExecutive.
    My target classes that needs to be documented reside
    in
    f:\projects\dsim\model\ATMqLen\Atmqlen.java
    and is the part of package called "ATMqLen".
    F:\> javadoc -private -doclet
    SExecutive.DiscoverClasses -docletpath
    f:\projects\dsim\SExecutive\ -sourcepath
    f:\projects\dsim\SExecutive;.f:\projects\dsim\model\AT
    qLen\ ATMqLen.Atmqlen.javaI believe the paths are wrong. You shouldn't include the package names in the paths; you just list the root of the package hierarchy.
    Also I think you're naming the java files wrong. You're mixing class naming style (dot separated) and file naming (the .java extension). I believe javadoc takes filenames. So rather than "ATMqLen.Atmqlen.java", you'd say "ATMqLen/Atmqlen.java", assuming that ATMqLen is a subdirectory of your current directory.

  • Help, how to install jvm and set the classpath using a batch file

    hello,
    i have created my java application and now have to create an installable / batch file which will install the JVM on the users machine and also the java packages such as javamail and the class files that i have created . it also has to set the classpath.
    i would like to know if anyone can tell me how to go about iti.e. how can i install the JVM using a batch file and then place the javamial packages etc in the apropriate directory .
    or is it advisable to explain it to the user how to go about it in tht user manual.
    and would also like to know that if i install the JVM will the path for the java.exe be set
    or will i have to set the path explicitly from the "batch file" so that the user can run the application without and problem just by running the java command followed by filename from the command prompt.

    hi,
    I have windows and I use it.
    The only problem with the free edition is that you can only create 1 launcher and that during the installation you get 1 popup showing that the installer was created with an unregistered version.
    Stijn

  • How to set the CLASSPATH in Unix Server

    Hi, everyone~
    Do anyone noe how to set the CLASSPATH in the hp-ux server? I tried the setenv CLASSPATH, but not working.. I think should use export. But my jsp pages still cannot working, dunnoe y?
    I wonder is the hp-ux support jsp and servlet or not?
    In order to let the jsp and servlet to run properly in the unix server, what kinds of steps should taken ?
    Hope somemore who experience with this situation b4 can give me some guidance.. Thanks~~
    regards,
    tzeyik

    Tomcat ignores any and all CLASSPATH environment variables. Even if you could figure out how to set it, Tomcat wouldn't use it.
    Better to learn how Tomcat's CLASSPATH works and how to deploy Web apps properly. - MOD

  • How to set the CLASSPATH for an  Sql Server 2005 database... help me please

    Hello! Guys I want to access a Sql Server 2005 database from Java.I've downloaded the JDBC 2.0 driver from Microsoft.I've copied the sqljdbc4.jar file to C:\Java\jdk1.6.0_14\db\lib.And I've added this to the classpath C:\Java\jdk1.6.0_14\db\lib\sqljdbc4.jar.The classpath variable is defined as a user variable.Well the point is that I get that nasty exception:Exception in thread "main" java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver.So if you know how to help me,please do so.Thank you :)

    Hi Timo,
    My jdev version is 10.1.3.3.0, this is for R12. By PR i mean to say process request and PFR process form request in the controller.
    In the Process request of the controller, i am finding the checkbox bean and assigning the firepartialaction for it.
    Later in the process form request for the fired event, i am trying to handle the rendered property of the messagetextinput. Is this a right approach?
    my code below
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OAMessageCheckBoxBean oamessagecheckboxbean = (OAMessageCheckBoxBean)oawebbean.findChildRecursive("X_FLAG");
    if(oamessagecheckboxbean != null)
    oapagecontext.writeDiagnostics(this, "Message check box Bean found:", 1);
    FirePartialAction firepartialaction = new FirePartialAction("change");
    oamessagecheckboxbean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR, firepartialaction);
    oamessagecheckboxbean.setFireActionForSubmit("change", null, null, true);
    oapagecontext.writeDiagnostics(this, "setting fire event", 1);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processFormRequest(oapagecontext, oawebbean);
    oapagecontext.writeDiagnostics(this, "Inside Process Form Request", 1);
    if("change".equals(oapagecontext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    OAMessageTextInputBean bean = (OAMessageTextInputBean)oawebbean.findChildRecursive("X_NUMBER");
    if(bean!=null){
    bean.setRendered(Boolean.TRUE);}
    Thanks,
    Malar

  • Novice Trying to Set The CLASSPATH Variable

    I am trying to compile a file (which can be downloaded at http://java.sun.com/docs/books/tutorial/getStarted/QandE/FirstClass.java). Despite being able to successfully compile several other files, this particular one will not compile. According to my JAVA Tutorial book, the problem may lie in the CLASSPATH variable, but I am having a great deal of trouble trying to set/understand it. My operating system is WINDOWS 2000. PLEASE HELP!!!

    in win 2000, the classpath can be set by the following process.
    Right Click My Computer icon and click on properties.
    (This can be done by going to the Control Panel and Double Clicking the System icon too).
    Once you have the properties window of the system click on the 'Advanced' tab.
    There is a button called 'Environment variables'.Click on it.
    You will have a part called 'System Variables' there.
    Here there is an entry called Classpath. Just add the entry of what you want to add to the classpath, separating each entry with a ';' semicolon as mentioned there and click on the Set button.
    That should set the classpath.If that does not take effect immediately, restart the system and it will take effect.
    Tell me if it worx.
    All the best. Bye!
    Cheers,
    Win!

  • How can i set the classpath??

    CAN ANYONE PLEASE HELP ME HOW TO SET THE CLASSPATH IN WINDOWS ME ,WHAT IS THE RIGHT CODE TO SET THE CLASSPATH I AM USING JDK1.3 VERSION.
    THANK YOU VERY MUCH
    ERICK LUCCIO

    Try this way Start->Program->System tools-> System Summary>startup .Try to find the variable classpath,make sure the path is correct.The classpath contain the the *.java & *.class you save. I'm also new in java .This path & classpath question is so trouble to me .Now i'm running jdk1.3.1_2 in WINME ,WINNT AND WIN2000 IN no problem.........

  • Setting the classpath of classes12.zip for Tomcat

    Hi
    I am using Apache Tomcat webserver and while trying to run a jsp page which intializes oracle.jdbc.driver.OracleDriver it throws an error
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    Please suggest how to set the classpath of classes12.zip in Apache Tomcat
    My Code Snippett
    <%@ page import="java.util.*,java.sql.*,javax.servlet.*"%>
    <body>
         <%
         Connection con ;
         ResultSet rs ;
         Statement stmt ;
         ResultSetMetaData rsmd ;
         try{ 
         Class.forName("oracle.jdbc.driver.OracleDriver");
         catch(Exception e)
         out.println(e);//print the exception on the command prompt
    %>

    The simplest way to do this is to copy classes12.zip to the WEB-INF/lib directory. The JSP should then find this automatically.
    As a side note, that is an ancient JDBC driver - you might want to upgrade to something from this millennium.

  • How to set the classpath and path from the jsp to call  java class function

    Hi Exprets,
    I have a requirement to call a java class function which returns a hashmap object from the jsp. The java class in present in one jar file and that jar file is location somewhere in unix path. So the requirement is to set the classpath for that jar file and then create the object of the java class and then call the function.
    If any one know how to achieve it, please reply as soon as possible.
    thanks in advance,
    swapna soni.

    It is never advisable to store large data sets in the session. But it will depend on a lot of factors:
    1. How costly is the query retrieving the data from the database?
    If it's a complex query with lots of joins and stuff, then it will be better to store it in the session as processing the query each time will take a lot of time and will decrease performance. On the other hand if the query is simple then it's advisable not to store it in the session, and fetch it each time.
    2. Are there chances for the data to become stale within a session?
    In this case storing the data is session will mean holding the stale data till the user session lasts which is not right.
    3. How many data sets does the session already holds?
    If there are large no. of data sets already present in the session, then it's strictly not advisable to store the data in the session.
    4. Does the server employ some kind of caching mechanism?
    Using session cache can definitely improve performance.
    You will have to figure out, what is the best way analyzing all the factors and which would be best in the situation. As per my knowledge, session is the only place where session specific data can be stored.
    Also, another thing, if the data set retrieved is some kind of data to be displayed in reports, then it would be better to use a pagination query, which will retrieve only the specific no. of rows at a time. A navigation provided in the UI will retrieve the next/previous data set to display.
    Thanks,
    Shakti

  • Where to set the classpath for custom classes in jsp

    Hi,
    we have created our custom classes in and ported in contentDB and that classes are internally using some jar files. Previously we have set the classpath of all the jar files provided in CDB devkit in the orion-web.xml but if are opening the explorer.jsp or any other jspx of contentDB we are getting the classcastexception and page is not opening.
    Is there any problem in setting the classpath. Please if any one knows abt this, reply as soon as possible.
    thanks,
    swapna soni.

    I think it is Oracle 10g Release 2... since when I click the top OAS link in the Enterprise Manager Console, it took me to 'Enterprise Manager 10g Grid Control Release 2' this page.
    And...10g Application Server Control Release 10.1.2.0.1, I think 2.0.1 means Release 2.
    Thanks and let me know if you need something else.

  • How to set the classpath for external .jar files after importing?

    Hi techs,
    How to set the classpath in WSAD5.1.2 after importing the .jar file to the WEB-INF/lib folder.
    urgent

    I got it.
    after importing the jar file to the perspective,we need to right click on project name, go to proprties,
    goto java build path,
    there we need to include the external jar files.

  • Java newbie questions...Setting the classpath in Unix

    When you set the classpath, how do you include anything already in the classpath? For instance, if your profile sets your classpath to
    "/home/weblogic/:home/weblogic/weblogic.jar, and you want to add MyJar.jar to it, can you enter:
    export classpath=~:MyJar.jar
    My question really boils down to how do you prefix the existing CLASSPATH environment variable to any new classes or jars you want to add to it. I think it's the tilde, but I'm not sure.

    In csh, the CLASSPATH environment variable is modified with the setenv command. The format is:
    setenv CLASSPATH path1:path2
    In sh, the CLASSPATH environment variable can be modified with these commands:
    CLASSPATH = path1:path2:...
    export CLASSPATH
    ====
    (From the Sun documentation)
    or, in sh,
    export CLASSPATH=path1:path2
    should work

  • How do I set the classpath in runtime?

    How can i set the classpath in runtime?
    Im downloading my image files in the folder C:/Downloads
    I want to set this C:/Downloads as my classpath.
    I don want to set it at the initial stage, bcoz I may have to change the downloading directory D:/Selva.
    I want to access my */utils/New.gif* image available in the downloading directory by using getResource() method.

    java.net.URL urldir= new java.net.URL("file://C:/Downloads/");
    java.net.URL[] urlarr= new java.net.URL[1];
    urlarr[0]=urldir;
    java.net.URLClassLoader urlcl= new java.net.URLClassLoader(urlarr); +// Here I get the Error+
    url=urlcl.getResource("/lrp/utils/New.gif");
    *Error: java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to set the classpath in CVM?

    Hi everybody,
    experimenting with the J2ME Personal Profile Runtime Environment on a Linux PC I wonder how to set the classpath. The command line options only allow me to set the bootclasspath.
    My original problems deals with determining the codebase for a class that is contained in a jar.
    1) If I put this jar into the bootclasspath, that class is found and can be loaded, but the codebase (retrieved using class.getProtectionDomain().getCodeSource) is NULL.
    2) If I put it into the classpath by using the command line option -Djava.class.path=... the class cannot be found by the ClassLoader.
    3) If I put the jar into both, the classpath and the bootclasspath, the latter one is applied and result 1) shows up.
    Any idea how to work around this?

    @see http://forum.java.sun.com/thread.jsp?forum=8&thread=410868

Maybe you are looking for

  • SSRS Silverlight HTML5 question

    Can anyone tell me when SSRS is in native mode (not SharePoint) does it use Silverlight? In particular, do the particular components use it. e.g. Report Builder, Report Viewer, SSRS web site? Also, are there any differences between SSRS versions: SQL

  • Is it possible to have different page sizes in one document?

    Hello everyone, I have never seen different page sizes in one document,but to make sure of this can someone confirm this? Thanks, Mor

  • Excel changes needed from RTF Template

    Hi all, I created RTF template which it publish in excel format.I am getting correct report but here i want some Excel settings from RTF template. These all properties i want in Excel  output file which is generated from RTF. 1) Page number must be d

  • Autonumber that increases whenever form is opened

    I have a very detailed form that I created in Acrobat 9 that has an autonumber field that increases by one everytime that it opens. I need to change some things on the form, so I want to work on it in LC ES. I am unable to find how to make this auton

  • Refactoring code in ADF

    Hi All, I have written an ADF application to help users browse through database records in a friendly manner. However, the underlying database has been tweaked by the DBA recently to remove a referential key. This has a significant impact on my appli