Problem in setting CLASSPATH and PATH

I am a newbie in java. I downloaded and run the "j2eesdk-1_4_01-windows.exe" from Internet. By default, it creates a new user variable, which is "PATH = C:\Sun\AppServer\bin". My problem is when I try to compile a java, I get an error message, which is
'javac' is not recognized as an internal or external command,
operable program or batch file.
I create a new user variable which is "CLASSPATH = .;C:\Sun\AppServer\jdk\bin"
and add new variable into my system variable, which is
"PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Sun\AppServer\jdk\lib"
However, it doesn't work and give the same error message. Any idea about the solution?
Thanks in advanced.

Your PATH variable needs to include the path to the J2SE SDK bin directory. It looks like you added it to your CLASSPATH instead

Similar Messages

  • Setting Classpath and Path on Windows ME

    Hi..How do I set up the classpath and path on windows ME. Do I use DOS or run the autoexec.bat from windows directly. I have jdk1.3.1 abd my classpath and path are:
    set classpath="C:\jdk1.3.1\bin"
    set PATH=C:\windows\xxxx\;C:\jdk1.3.1\bin
    I sometimes can't compile my programs from other directories other than jdk1.3.1\bin. Why? Is there a way I can compile my program just from the C:\ directory like:
    C:\javac myprogram.java
    C:\java myprogram
    Thanks.

    If you put . in the beginning of your classpath, java always searches the folder you are currently in.
    Now to set the classpath try clicking from the startmenu:
    settings/control panel/system. Then click advanced tab and then the Enviroment variables. I'm on win2000 but I think it should be the same on ME.
    Make sure it starts with .;C:\jdk1.3.1\bin;....
    I think installing jdk puts in the essentials, but if you have certain folders you store your classes in you can stick those in there as well.
    If you hava more questions about this, I suggest searching these forums on Keywords like : "set CLASSPATH PATH". Then you'll find a bunch of threads solving this problem.
    Sjur

  • Setting CLASSPATH and PATH properly how?

    I have set PATH=c:\jdk_install_directory\bin which works fine. However, for example when I create an app or small program for example, simply to print out a line on the screen, it works when I compile in NetBeans. However, if I copy the java file to another directory, my C: root for example, I can compile it, but when I run the class file it gives me errors saying it can't find certain classes. So, I figure its something with the classpath variable that I have to fix. How can I do this properly for both J2SE and J2EE using default install directories for each.
    Thanks so much!!

    Your PATH is exactly what it should be.
    The CLASSPATH answer depends on where you're compiling and running.
    If you're doing things on the command line, I think the right answer is to use the -classpath option on javac.exe and java.exe.
    If you're using NetBeans or another IDE, the right answer is to add JARs and paths according to the idiom demanded by the IDE. Each one is different, and all the ones I know of ignore the system CLASSPATH environment variable. I don't have one set on my machine.

  • Problems in Classpath and Path 's variables setting in Windows XP

    Here is my drive structure in my PC:
    1. hard drive (primary slave, Partition: C and E where E boot Windows XP
    2. Hard drive 2 (Primary Master), Drive letter: D
    Although my default boot directory is E (for strange reason, i like to keep
    that way for now), I installed other programs in C and D drive dues drive
    space factors.
    So My java sdk1.4.2_02 has been installed in C:\Java_home directory, the
    following is my Classpath and Path values:
    (CLASSPATH Variables)
    Classpath=.;
    c:\java_home\j2sdk1.4.2_02;
    e:\Program Files\java\j2re1.4.2_02;c:\java_home; c:\java_home\j2sdk1.4.2_01
    \lib;e:\Program Files\java; e:\Program Files\java web start;c:\java_home\j2
    sdk1.4.2_02\jre\lib;c:\java_home\java\petstore1.3.2\src\lib\jst1;
    (PATH variables)
    c:\java_home\j2sdk1.4.2_01\bin;C:\java_home;e:\Pr
    ogram Files\java;c:\java_home\jdk1.4.2_2\bin;E:\Program Files\Oracle\jre\1.
    1.8\bin;E:\WINDOWS\system32;E:\WINDOWS;E:\WINDOWS\system32\WBEM;E:\
    Program Files\Support Tools\;
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    Path=D:\oracle\ora92\bin;E:\Program Files\Oracle\jre\1.3.1\bin;
    My Fruit txt and Fruit.java file is located in my c:\java_home folder
    when I try to compile the my file as <c:\java_home\javadoc Fruit.java), it
    gives me the error message<'javac' is not recognized as an internal or
    external command,operable program or batch file.>
    however, I can compile the Fruit file from C:\java_home\jdk1.4.2_2
    \bin\javadoc Fruit.java; with out any problem of course I have to copy the
    Fruit.java file at the C:\java_home\jdk1.4.2_2\bin\javadoc Fruit.java
    folder.
    I am requesting u please help or advise me to correct my mistakes
    Ely
    [email protected]

    I must confess that I am totally unable to understand what your PATH is set to. The error that you see,
    <'javac' is not recognized as an internal or external command,operable program or batch file.>
    is due to a missing or incorrectly set PATH. It is used by Windows to find executable file (like javac.exe) that you have added to the computer. Item #5 on this page gives you instructions on how to set it: http://java.sun.com/j2se/1.4.2/install-windows.html
    As for the setting of the CLASSPATH, you seem to have a number of different versions of java (1.4.2_02, 1.4.2_01, 1.4.2_2, and 1.1.8) and I doubt that these are all valid. You are also using an unusual syntax C:\java_home\jdk1.4.2_2\bin\javadoc Fruit.java and I wonder if that is really C:\java_home\jdk1.4.2_2\bin\javadoc\Fruit.java? I think the best action is to point you to Sun's instructions and information about setting and using the CLASSPATH.
    The CLASSPATH is a set of pointers that is used by Java to find the files that YOU (not Java) create and want compiled and/or run.
    Setting the Classpath:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html
    [NOTE: always start your classpath with ".;" which means the current directory. See my classpath, below]
    How Classes are Found:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html
    Examples:
    This is my path
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.2_01\BIN;C:\PROGRA~1\UTILIT~1;C:\PROGRA~1\WIN98RK
    This is my classpath
    CLASSPATH=.;C:\mjava;C:\mnrx;C:\NetRexx\lib\NetRexxC.jar;C:\j2sdk1.4.2_01\lib\tools.jar;C:\NetRexx\NrxRedBk

  • How to set classpath and server configuration in eclipse

    i am new to eclipse tool pls anyone tell me to set classpath and serverconfiguration (tomcat) and sample program

    Get WTP [1], install it [2] and checkout one of the lot Eclipse WTP tutorials [3].
    [1] http://www.eclipse.org/webtools/
    [2] http://ftp.osuosl.org/pub/eclipse/technology/phoenix/demos/install-wtp/install-wtp.html
    [3] http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html

  • Setting classpath and library path...

    hello..
    i have downloaded the jfreechart1.0.4 for adding chart in my java application...though i have gone through the installation guide...but i havent figured it out how to make the packages available to my java application....
    i am very new to java ....so pls suggest me any way to make those packages available to my java which is in my j2sdk\bin folder...and truly i dont have any idea where to set the lib path and class path....so pls post any suggestion or any url that will help me...

    Hi,
    You should not place files in the bin directory of your JDK/JRE. Just place the jar-files somewhere close to your application, e.g. in a lib folder in your project folder. Then set the classpath to point to those jars when you execute your application.
    E.g.
    java -classpath ./classes/;./lib/somejar.jar;./lib/anotherjar.jar MainClassKaj

  • Problems in setting classpath in vista

    i am using Xp pro and Vista.
    My issue is that I am not able to set classpath in vista.
    i want to set classpath so that I can compile and run programs from different folder other than default one in which java is installed.
    Please help.

    i am using Xp pro and Vista.
    My issue is that I am not able to set classpath in
    vista.
    Don't worry about it. The CLASSPATH variable is best avoided anyway. Specify classpaths for particular apps on the command-line. Teh Docs show you how
    i want to set classpath so that I can compile and run
    programs from different folder other than default one
    in which java is installed.
    Please help.This suggests you're talking about PATH rather than classpath. Do you understand the difference?

  • Classpath and path of jdkjdk-1_5_0_09

    hi
    i have installed c:\progrmaefiles\java\ jdk-1_5_0_09 on my pc but i m not able set systemenvironment variable like PATH and CLASSPATH .i tried lot of option but it does not work so plz anyone help me out.i m using windows Xp operating system. when i m running any java programe i m getting error " Exception in thread "main" java.lang.NoClass.DefFoundError.plz hep me out.
    thx manu

    That's CLASSPATH, not PATH.
    Without seeing your exact directory structure and the exact command you're runing, nobody can give you specific advice. Here are some explanations of how it works, though.
    Javapedia: Classpath
    How Classes are Found
    Setting the class path (Windows)
    Setting the class path (Solaris/Linux)
    Understanding the Java ClassLoader
    java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.
    javac -classpath .;<any additional jar files or directories> YourClassName.javaYou get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

  • Setting classpath and creating packages

    Hi
    I am new to Java and my questions are basic.
    1)I am using the kawa IDE and i dont know how to create and use packages.
    2)Creating classpath to compile and run java programs from the Dos prompt.
    I would appreciate any help on these questions

    I'm not sure how to use KAWA.
    When it comes to classpaths, though, I would recommend not setting it as an environment variable - this tends to cause confusion if you work on more than one project at a time on your machine. Either set it locally or specify it directly on the command line.
    Often it's a good idea to write a batch file for compiling and executing your code:
    setlocal
    set PATH=c:\j2sdk-1.3
    set CLASSPATH=c:\jars\Servlet.jar
    javac MyClass.java
    endlocalHope this helps.

  • 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

  • Post jDev 903 cleanup: Classpath and Path.

    Having installed the new [complete set] 9.0.3 and having decided NOT use 9.0.2 or other developer suite tools, it's time to clean up my path and classpath settings.
    Please help me sort it all out. Thanks.
    Per instructions I did not install the new 9.0.3 into any existing oracle_home. The home_dir for the 9.0.2 and complete suite is: E:\Programs\OraDevSuite.
    My Classpath has three entries: (formatted for easy reading on the forum.)
    CLASSPATH=
    E:\Programs\OraDevSuite\jlib\bigraphbean.jar;
    E:\Programs\OraDevSuite\jlib\LW_PfjBean.jar;
    E:\Programs\OraDevSuite\jlib\bigraphbean-nls.zip
    Questions: 1. Can (Should) I throw these out? 2. Do I need anything else in the classpath? (The java command line uses the -classpath parameter anyhow.)
    Here are the PATH settings (in the order maintained by the os). This really needs to be cleaned up. I have added my question on each line. Sounds like alot of questions but many are the same type.
    Path=
    E:\Programs\OraDevSuite\bin; (Old suite: Good-bye?)
    E:\Programs\OraDevSuite\jdk\jre\bin; (Old suite: Good-bye?)
    E:\Programs\OraDevSuite\jdk\jre\bin\classic; (Old suite: Good-bye?)
    E:\Programs\OraDevSuite\jdk\jre\bin\classic; (Old suite: Good-bye?)
    E:\Programs\OraDevSuite\jlib; (Old suite: Good-bye?)
    E:\Programs\OraDevSuite\bin; (Old suite: Good-bye?)
    E:\ORACLE\bin; ( How do I verify if this is needed by 9iDB or OEM?)
    C:\Program Files\Oracle\jre\1.3.1\bin; ( Since 9.0.3 comes with its own can I REMOVE this FROM THE DISK? )
    C:\Program Files\Oracle\jre\1.1.8\bin; ( Can I remove this from the disk? )
    C:\WINDOWS\system32;
    C:\WINDOWS;
    C:\My Programs\Java\sdk1_3\bin; ( Can I remove this from my disk? )
    **********THANK YOU!**************
    -Nat

    If you downloaded the full version of 9.0.3 Dev Preview (the 160MB sized-one), then it's completely self-contained. Just unzip it and go. Anything else can be removed.
    If you downloaded the "base" version, then you'll need to keep a JDK 1.3 around and edit your .\jdev\bin\jdev.conf file to SetJavaHome to point at your JDK home location.

  • Classpath and Path in Win2k Server

    Hi
    My OS is windows 2000 Server
    I installed Jdk 1.3.x Version.
    Do I need to set path and class path to my system to run sql package files...
    What shalll i include in my path and in class path.
    If any one having idea, please help me.
    Thanks in advance
    Yours
    Rajesh

    Dear dewangs,
    Thankyou VeryMuch
    Do I have to keep tools.jar file in my path or else in my class path ?
    Thanks in advance
    Yours
    Rajesh

  • Problem with setting classpath

    Hi,
    I am trying to set up jclasspath using following statement
    set path=%classpath%;C:\j2sdk1.4.2_09\bin;C:\Sun\AppServer\lib\j2ee.jar;
    But i am getting the following error :
    StatusUpdate.java:9: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    StatusUpdate.java:10: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    What am i doin wrong?
    Thanks
    Vivek

    well for one the statement you showed is setting path, not classpath
    PATH : the order in which the operating system searches for programs to run (windows property)
    CLASSPATH : the default locations it looks for java classes when you run javac or java
    the java/bin directory should not need to be in the classpath.
    Instead you should have the current directory in the classpath when you are compiling from command line.
    set path=%classpath%;.;C:\Sun\AppServer\lib\j2ee.jar;
    How are you compiling - via the command line?
    try: java -classpath .;C:\Sun\AppServer\lib\j2ee.jar StatusUpdate.java

  • Problems with packages, classpath and BouncyCastle Library

    Hi everybody!
    Shortly, after adding BC's crypto library to my MOBILE (J2ME) project, when I build it returns a NoClassDefFoundError about java.math.BigInteger class.
    Its package is the same of J2SE but is included in this library. Now, this should not be a problem, 'cause java.math.BigInteger is not included in J2ME, and library's release is (I'm sure) for J2ME...I think it's a problem of classpath but I can't find a way to go on with my project!
    Please, if anybody knows where I'm wrong let me know!!!
    ...and sorry for my bad english...;-)
    b4kk3

    I think the update is buggy. Many people (inc. me) are having problems with it. Am not able to play any songs/videos .. terrible !

  • Several Problems about setting tabs and MMS

    Hello,
    I have recently started using my Unlocked Iphone 4 with T-mobile and have encountered a few problems.
    1.) I am missing a few settings such as network, MMS, cellular editting, ect.
    2.) My phone perfers Edge over 3g and only picks up 3g when I am on the road.
    3.) my Phone drops connection a lot and goes into "searching..."
    4.) I can not group chat BUT I am still able to text
    How would I be able to fix the problems at hand?
    Would I be able to go to the genius bar even if I bought my iphone on craigslist? I still have the original SIM from the owner.

    brianhasazoo wrote:
     2.) My phone perfers Edge over 3g and only picks up 3g when I am on the road.
    NO, not entirely correct.  TMO has a very limited 3G network that is compatible with the iPhone.  This is one of the downsides of using an iPhone on TMO.  Until TMO upgrades their network to provide more 3G coverage that is compatible with the iPhone, users with iPhones will be restricted to the EDGE network.

Maybe you are looking for

  • Add calculated field (Query - SQ01)

    Hi to all, I would know how can i add a calculated field to a Query (SQ01) ? Can you give me an example of abap code to insert in CODING section ? thks

  • Can't synch blackberry & ibook

    I have been synching my blackberry 7250 to a pc running outlook and now want to switch to my ibook with ical and apple mail. I have installed pocket mac, and run synch clean, and am connecting via usb. Isync appears to synch the devices but it runs v

  • Problem Opening RAW files

    I have Photshop CS6 Extended but when I click on the .cr2 which is the RAW file I keep getting an error message "Could not complete your request because it is not the right kind of document" Any suggestions? I have tried installing the camera raw plu

  • My tablet and me...(tablet is a genius f-610)

    Ok so a while back I bought a Genius g-pen f-610. I know its not the best tablet out there but it was cheap and large and looked like a good deal. I got home installed everything, and then barely used it for a while thus I never noticed the things it

  • Web dynpro rfc  model reference

    Is there a way to change the  jCOclient reference of  rfc model after creating the model for example from WD_RFC_MODELDATA_DEST to WD_R3_RFC_MODELDATA_DEST