Unsure about Classpath variable

What should the classpath variable be set to? I am working through a tutorial from the command line for the first time and running into problems with classdefnotfound errors. It's saying to run it using java -classpath, but I thought that was just a shorter way to say what folder your workspace files are in. What should this be set to?

The environment variable CLASSPATH should not be set to anything. It should not exist.
If you do not include a -cp (or -classpath) command-line option, then the system looks for a CLASSPATH environment variable. If it finds it, it acts the same as if you had used that for the -classpath command-line option. If it does not, then it by default acts as if you included the "current directory" only as the -classpath.
If you do include a -cp / -classpath command-line option, then the system ignores any CLASSPATH environment variable anyway.
All "real" systems do not rely on a CLASSPATH environment variable. IDEs don't use it; J2EE containers (weblogic, jboss, etc) don't use it; applets don't use it; etc etc etc. It's basically only there for "toy" applications and beginners to try and make their life a little easier. However it just turns out to have confused them even more.

Similar Messages

  • 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 figuere out my classpath variable

    the tutorial is saying that i need to create and appropriate class path. i know wer to go to set it but what should i set it to. if that makes any sense. you see im trying to run the hello world program and ive tryed everything but setting the classpath variable so that the os will know were to go to look for the information but i dont really know what state the path is in and i dont know what to set it to. id greatly appreciate the support.

    Open a Command Prompt window and type "echo %CLASSPATH%" on windows or "echo $CLASSPATH" on unix.
    That will show you your existing CLASSPATH.
    Mine looks like this:
    .;C:\program files\j2sdk1.4.2_02\jre\lib\rt.jar
    The Classpath contains all the jars and class folders that your program needs separated by ; (windows) and : (unix). So if your classes are in the folder: myapp\classes, then add
    ;myapp\classes
    to the end of your classpath.

  • Tables where I can find information about IP variables, Infoprovider aggreg

    Hello All,
    Tables where I can find information about IP variables, Infoprovider aggregation level and filter.
    The tables where we have info about tthe user exit variables. Similar to that of UPC* tables in BPS.
    Thanks a lot,
    Karthik Krishna

    RSRPARAMETRIZA for Bex Analyzer 7.0
    RSRVARIANTDIR     for Bex Analyzer 3.x
    RSRVARIANTDIR     Directory of Variants for Queries and Selection Objects               
    RSRVARIANT             Variant Values BEX               
    We can access to value of one variant with name of query COMPUID (from RSRT --> Technical Informatione -->Data from Query Definition  --> Techn. Definition Name) or with the name of Variant from RSRVARIANTDIR (the same for the technican nema of query COMPUID)
    Edited by: Pierfrancesco Marvulli on Aug 31, 2011 3:23 PM

  • Question about classpath on startup

    Hello,
    I need a clarification about classpath value on Weblogic startup.
    I set "Class Path" value by Administration Console.
    When I start my Weblogic Server by "startWebLogic.sh" my classpath modification is not working. It need that just restart my server by Administration Console and it's working !!
    Can you help me about it ?
    Thanks (and sorry for my english...)

    Hi Julien,
    When we set "Class Path" value by Administration Console that would only be taken when you start the managed server using the node manger and not when you are using a star-up script.
    Hence when you start the managed server using the console it picks up the class path which is set on the Admin Console and when you start he server using the start-up script that would pick up the class path which is been set in the start-up script not the console one.
    Regards,
    Ravish Mody
    http://middlewaremagic.com/weblogic/
    Come, Join Us and Experience The Magic…

  • Classpath variable

    Can someone please help me with what exactly the classpath variable does? I have my java and javac.exe files located in C:\Program Files\Java\jdk1.5.0\bin. I can only compile and run files that are located in this directory. So if I put my HelloWorld.java file in that directory and run the compiler, it does create a HelloWorld.class file in that directory too. When I run the file using java HelloWorld the program runs fine.
    How can I save the files in other directories but still compile and run them? Any help would be great.
    Thanks.

    classpath variable is where u specify a path with files and such in it.
    Ie \Java\jdk1.5.0\bin has got files like javac.exe and such which can normally only be run from that folder but if u specify that folder as a classpath variable it means that u can run the file javac.exe from anywhere in the computer.
    To do this I have created a batch file I run every time.
    part of it is:
    set JAVA_HOME=C:\j2sdk1.4.2_05
    (no need to specify the bin folder I think)
    if u have something like XP look at system in the control panel under a button called environmental variables and add in that path
    Regards, Rory

  • CLASSPATH variable problem

    I have downloaded the Java 3D API but the compiler keeps telling me off for the java 3d packages not existing. How can I make it understand where the packages are and how to access them?
    Thanks Rufus,

    you must set the CLASSPATH variable to point to the java3d api jar files. Install the java3d to a jdk, then set the class path to include these jar files, go to the command line and type:
    C:\>SET CLASSPATH=%CLASSPATH%;c:\jdk1.3.0_02\jre\lib\ext\j3daudio.jar;c:\jdk1.3.0_02\jre\lib\ext\j3dcore.jar;c:\jdk1.3.0_02\jre\lib\ext\j3dutils.jar;c:\jdk1.3.0_02\jre\lib\ext\vecmath.jar
    *Assuming that the c:\jdk1.3.0_02\jre\lib\ext is the path to the java3d jars.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Help me !! how do i configure the CLASSPATH variable in windows xp??

    I've just downloaded the new java envirolment platform 1.4
    but i don't know what to I have to write in my CLASSPATH variable
    in windows xp
    with my previous version (1.3) the variable was:
    CLASSPATH value=d:\java\j2re1.3.1\lib\tools.jar
    with this new version I don't see any tools.jar file in my java directory ;
    what to I have to to ??
    another thing:
    do the "javac" command works with the new version of the platform ??
    thanks to anyone who will answer

    does it have a autoexec.bat? It chould go in there.

  • Why did eclipse add a CLASSPATH variable to my system?

    After recently installing eclipse I discovered that while I can still compile normally I was getting NoClassDefFoundError running java from my command prompt.
    After some puzzlement and wondering if I had gone crazy I noticed the new environment variable CLASSPATH.
    Two questions.
    1) Why?
    2) Can I get rid of it safely or will that give eclipse upset?

    I recently installed two things. Eclipse andiTunes
    (but only because I
    wanted QuickTime). So I guess it was iTunes. Howvery bizarre.
    Just out of curiosity: what was the value of that
    CLASSPATH variable?
    kind regards,
    JosUmm I already deleted it but it was pointing to
    something javaish. I think something in the lib/extActually I still had a command window open and env said this
    CLASSPATH=C:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip

  • Setting my Classpath variable

    Hi
    Could someone please help me get the classpath variable working
    C:\Java\sampledir\Java Game Programming;.;C:\Program Files\s1studio_jdk\j2sdk1.4.1_02\lib\tools.jar
    This is what I have in the Classpath variable now in my Windows 2000 O/S
    Now from what I gather with having this set up in the classpath I should be able to compile anything in the Java Game Programming Folder and I can do it right from the C:\ prompt. Am I correct in thinking this?? or do I need to be in the directory with the file I want to compile??
    The error message I recieve after typing from the C:\ prompt javac GameOver.java
    produces this error message
    error: cannot read: GameOver.java
    1 error
    Now I do know everything within the file is correct because it compiles and runs successfully in Sun One Studio. :)
    Thank you
    Scott

    The classpath is a way for the compiler to resolve class names it encounters in the source files.
    But you still have to give it the exact path to your source file !
    you don't need to be in the directory of the file, you can just give its absolute path from whatever directory you happen to be.

  • Help with CLASSPATH variable please

    Hi everyone!!
    Please, help to set up my classpath variable. I know I know I have guidelines in API but I don't achieve it, I'm so clumsy.
    I've formated my hard disk and installed everything again, but the classpath is wrong because I can't compile my java files.
    I've tried with this:
    C:\Program Files\Java\jdk1.5.0_06\scr.zip;C:\Program Files\Java\jdk1.5.0_06\javac.exe;C:\Program Files\Java\jdk1.5.0_06\java.exe
    I've also tried with the same lines but unnaming files (finishing with '\')
    What am I doing wrong?
    Thank you very much for your attention and help.
    Merry Christmas and Happy New Year!!
    And I hope the Three Wise Men bring you everything!!

    Please post your exact problem and the exact error message. I think you are having a problem compiling, but I am not sure. What is not working? What is the error?
    You posted a path, but if that is your Classpath, you should not have javac or java in the Classpath.

  • Question about Local Variables (Multiple answers welcomed!)

    A couple of questions about Local Variables
    1. Programmers always say: “Do not abuse of Local Variables”. I’d like to know, when and where Local variable are most efficiently used?
    2. If I have to create a couple of local variables, is there anyway to “clone” them without going through the repetitive “create/local variables” mouse click each time? (When I try to copy and paste, it creates a new variables instead of the one that I am trying to reproduce)
    3. Which is faster in execution: Updating a variable through a) writing to property node/value or b) through local variable
    Everyone’s input is welcomed, so if this question is already answered, please
    feel free to add additional comments/answers!

    1. Use Local Variables in user interface code and no where else. The only exception is using a local variable of a cluster output to define the datatype for a bundle by name node.
    2. You can drag copy them then right click to get to a menu of all the currently defined controls and indicators on the VI.
    3. B. The problem with A is that it forces a thread switch to the user interface thread--which can take time if you aren't already in it, and it's a very convoluted process under the hood. NI's advice never update indicator values through a property node unless you absolutely, positively can't figure out some other way of doing it.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Jgrasp classpath variable

    well here is the deal, i am using JGrasp to compile and excecute my programs, i set the PATH variable and the CLASSPATH variable to the appropriate directories. but still i get the following error message when i run JGrasp:
    "Unable to initialize threads: cannot find class java/lang/Thread"
    i think that is because jgrasp is still not using the correct CLASSPATH that i set. when i looked at the JGrasp control shell i found the following startup command:
    "C:\JDK1.1.6\BIN\java.exe" -classpath "jgrasp.jar" Grasp -i -j "C:\JDK1.1.6\BIN" -s "C:\My Documents" -e "C:\jGRASP_extensions"
    i think that is the problem, since jgrasp change the classpath variable to "jgrasp.jar" when it is started. does anybody has any clue on how to fix this? thx

    http://www.eng.auburn.edu/department/cse/research/grasp/jgrasp/main.htm
    Quote below is from right at start of the above link. Also includes instructions on setup, installation and running same.
    Should tell you what you need to know.
    Important Notes
    This is jGRASP version 1.5.3 Beta 2. Check http://www.eng.auburn.edu/grasp/ for the latest version of jGRASP.
    jGRASP is written in Java. Java 1.2 or higher must be installed on your machine in order to run jGRASP. The full JDK 1.3 or higher (not the JRE) from Sun is required in order to use the integrated Java debugger.
    jGRASP does not include any compilers. The JRE bundled version and all other versions of jGRASP do not include a Java compiler. In order to compile programs you must have a compiler installed.
    Which JVM to Use
    If you have downloaded a JRE bundled version of jGRASP, this is not a concern. Otherwise, Sun JDK 1.4 is suggested. When jGRASP starts, you may get a message telling you that jGRASP has known problems or minor problems, or has not been tested on your system.
    To use the integrated Java debugger, JDK 1.3 or higher is needed (and you should develop under 1.3 or higher also).

  • Check your CLASSPATH variable.....

    I 'm trying to run the demo (Linux envinroment) and I get this error though Classpath is set...
    see the display below >>>
    lando@lando-desktop:~/DERBYTUTOR$ echo $CLASSPATH
    :/home/lando/jdk1.6.0_11/db/lib/*.jar
    lando@lando-desktop:~/DERBYTUTOR$ java WwdEmbedded
    ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
    >>> Please check your CLASSPATH variable <<<
    . . . exception thrown:
    ---SQLException Caught---
    SQLState: 08001
    Severity: 0
    Message: No suitable driver found for jdbc:derby:jdbcDemoDB;create=true
    java.sql.SQLException: No suitable driver found for jdbc:derby:jdbcDemoDB;create=true
    at java.sql.DriverManager.getConnection(DriverManager.java:602)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at WwdEmbedded.main(WwdEmbedded.java:72)
    Getting Started With Derby JDBC program ending.
    Where is the problem ?
    Thanks a lot.
    Edited by: lndo on Feb 5, 2009 11:33 AM

    Classpath setting in .bashrc is below ...and is correct
    export CLASSPATH=$DERBY_HOME/lib/*.jar:.;
    and I can disply it >>>
    lando@lando-desktop:~$ echo $CLASSPATH
    :/home/lando/jdk1.6.0_11/db/lib/*.jar:.
    and its containt is here >>>
    lando@lando-desktop:~/jdk1.6.0_11/db/lib$ ls
    derbyclient.jar        derbyLocale_it.jar     derbyLocale_zh_TW.jar
    derby.jar              derbyLocale_ja_JP.jar  derbynet.jar
    derbyLocale_cs.jar     derbyLocale_ko_KR.jar  derbyrun.jar
    derbyLocale_de_DE.jar  derbyLocale_pl.jar     derbytools.jar
    derbyLocale_es.jar     derbyLocale_pt_BR.jar  derby.war
    derbyLocale_fr.jar     derbyLocale_ru.jar
    derbyLocale_hu.jar     derbyLocale_zh_CN.jarbut if before launching the program I type in command line >
    CLASSPATH=$DERBY_HOME/lib/derby.jar:.;
    It works fine ....as if /db/lib/*.jar:. could not get derby.jar !

  • Can't Edit ECLIPSE_HOME Classpath Variable

    Hi,
    I am trying to edit ECLIPSE_HOME Classpath Variable, which i can do as long as Dev Studio is open. If I close NWDS and re-open it, the change to the variable is lost. Any ideas?
    Thank-you,
    -Kevin

    Kind of a drastic step to take as this is basically starting from scratch, but it does work. I was hoping there was a way to access where these variables are stored to modify it, but no such luck.
    Thanks,
    -Kevin

Maybe you are looking for

  • Have to scroll to view text in email - GAFE Account in mail app

    We have been having an issue with users that have their Google Apps for Education account set up in the mail app on an iphone. When they receive an email, from time to time the email's text does not fit in the phones display and the user has to scrol

  • New @ RMI need help with  java.rmi.UnmarshalException: error unmarshalling

    Hi @ all out there, I'm new with Java RMI and have to write a EventSystem for an college project where clients can subscribe to a topic and get notified when someone publishes a message to the subscribed topic. At server-side I have a class called Ev

  • Can't find any of my contacts

    I have just restored my iphone 3GS and upgraded to ios 5.1 but all my contacts have gone missing. Every other thing is there including call history and messages (just the numbers, no names). I have snyched my phone numerous times but the contacts sti

  • [SOLVED]No sound after installing oss

    I am installing oss on my x86_64 pc. But I get the following when I type in " soundon ": Relinking OSS kernel modules for "3.14.2-1-ARCH SMP preempt mod_unload modversions " This may take few moments - please stand by... OSS build environment set up

  • Copy of standard network

    Hi Friends, I am trying to copy standard network template in CN01 but all activities are coming by default, I want to remove the activities but when i try to delete them I am getting message CP654- You can only select created records. Kindly help. Th