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?

Similar Messages

  • 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

  • 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 setting classpath...

    hello guys...i am having a problem with what should be a very simple operation...
    the classes i define are stored in the classes directory..inside, each package has its own subdirectory...
    classes
    beans
    User.class
    Cart.class
    i have tried to change my classpath to reflect this location and instruct the compiler as to where to find those classes..
    i have used the set Classpath command...
    SET CLASSPATH=.;C:\Tomcat\common\lib\servlet-api.jar;C:\Tomcat\common\lib\mysql-connector-java-3.1.13-bin.jar;
    C:\Tomcat\webapps\theagent\WEB-INF\classes beans.User;
    but when i try to import beans.User in another class..it doesnt compile and tells me that the package doesnt exist...
    please help....what else do i need to check to make sure the configuration is as it should be...
    p.c User.java started with package beans;
    thanks

    That is correct because your beans.User class doesn't contain a
    public static void main(String[] args) method, iow you can't run it by itself.i dont want to run the class by itself... i just want to import beans.User;
    but it says that no such package exists...Then you have to be a bit more clear. You mentioned this command line:java -classpath C:\Tomcat\common\lib\servlet-api.jar;
    C:\Tomcat\common\lib\mysql-connector-java-3.1.13-bin.jar;
    C:\Tomcat\webapps\theagent\WEB-INF\classes beans.User;This sets the classpath pointing to two jars and a 'classes' directory.
    You're trying to run the 'beans.User' class which I presume is stored
    in a subdirectory of that 'classes' directory.
    The java command works like this:java -classpath <jars and dirs here> package.YourClass... so you were trying to run your beans.User class all by itself. It doesn't
    contain a main method hence the runtime diagnostic. btw, I don't know
    why you appeded that whole thing with a semicolon.
    kind regards,
    Jos

  • A problem regarding set up of Oracle Lite 3.6.0.2.0 on Win 95, with JDK 1.1.8 &java 2

    A problem regarding set up of Oracle Lite 3.6.0.2.0 on Win 95, with JDK 1.1.8 and Java 2 SDK ( Ver 1.3 Beta)
    After the installation of Oracle Lite 3.6.0.2.0 on a laptop (with WIN 95 OS), When I run Oracle Lite Designer from start menu, I receive following error message :
    ====================================
    Invalid class name 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    usage: java [-options] class
    where options include:
    -help print out this message
    -version print out the build version
    -v -verbose turn on verbose mode
    -debug enable remote JAVA debugging
    -noasyncgc don't allow asynchronous garbage collection
    -verbosegc print a message when garbage collection occurs
    -noclassgc disable class garbage collection
    -ss<number> set the maximum native stack size for any thread
    -oss<number> set the maximum Java stack size for any thread
    -ms<number> set the initial Java heap size
    -mx<number> set the maximum Java heap size
    -classpath <directories separated by semicolons>
    list directories in which to look for classes
    -prof[:<file>] output profiling data to .\java.prof or .\<file>
    -verify verify all classes when read in
    -verifyremote verify classes read in over the network [default]
    -noverify do not verify any class
    -nojit disable JIT compiler
    Please make sure that JDK 1.1.4 (or greater) is installed in your machine and CLASSPATH is set properly. JAVA.EXE must be in the PATH.
    ====================================
    My ORACLE_HOME is c:\program files\ora95_2 and Oracle Lite is installed under the ORACLE_HOME in LITE\DESIGNER directory.
    JDK version is 1.1.8 which is greater than 1.1.4 installed in c:\program files\jdk1.1.8, My PATH, and CLASSPATH are set in AUTOEXEC.BAT as follows:
    set CLASSPATH=c:\Progra~1\jdk1.1.8\lib\classes.zip;c:\progra~1\ora95_2\lite\classes\olite36.jar;c:\progra~1\ora95_2\lite\designer\oldes.jar;c:\progra~1\ora95_2\lite\designer\swingall.j ar
    PATH=C:\Progra~1\Ora95_2\bin;.;c:\Progra~1\jdk1.1.8\lib;c:\Progra~1\jdk1.1.8\bin;C:\Progra~1\Ora95_2\lite\Designer;C:\WIN95;C:\WIN95\COMMAND;C:\UTIL
    And, I can run JAVA.EXE from any directory on command prompt.
    With JAVA 2 SDK (ver 1.3 Beta) instead of JDK 1.1.8 I'm getting a different Error message as follows:
    =============================
    java.lang.NoClassFoundError: 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    Please make sure that JDK 1.1.4 (or greater) is installed in your machine and CLASSPATH is set properly. JAVA.EXE must be in the PATH.
    ==============================
    the PATH and CLASSPATH were set accordingly, as with JDK1.1.8, and there was no classes.zip in classpath
    also the class file or the jar file looks weird or wrapped in the error message : 'FILES\ORA95_2\LITE\DESIGNER\oldes.jar;C:\PROGRAM'
    Another interesting thing I noticed is if I run oldes.exe from Installation CD, the Oracle Lite Designer runs fine, and without error, I'm able to modify tables in the database of my laptop also.
    Could someone shade some light on what am I doing wrong here ?
    Thanks for help in advance .
    Regards
    Viral
    null

    On 07/20/2015 06:35 AM, Itzhak Hovav wrote:
    > hi
    > [snip]
    > [root@p22 eclipse]# cat eclipse.ini -startup
    > plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
    > --launcher.library
    > plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
    >
    > -showsplash
    > org.eclipse.platform
    > --launcher.XXMaxPermSize
    > 256m
    > --launcher.defaultAction
    > openFile
    > -vmargs
    > -Xms40m
    > -Xmx512m
    > [snip]
    Try this: http://wiki.eclipse.org/Eclipse.ini. You should have read the
    sticky posts at forum's top for getting started help.

  • Trouble Setting Classpath on Windows XP

    I'm having trouble setting up a classpath on Windows XP for SDK1.3.1_04.
    I've tried Control Panel\Advanced\Environment Variables\System Variables. There was a Path variable present, to which I've added:
    c:\jdk1.3.1_04\bin;
    There wasn't a Classpath variable present though. I've tried adding it myself in System Variables as follows:
    Variable name: Classpath
    Variable value: set classpath=.;
    But no joy. When I run "set" from the command prompt, there's no classpath present.
    I'd appreciate any help.
    Cheers.

    Hi,
    I am running on XP (unfortunately), but also win2000 and win98.
    Setting up the classpath is not a problem, although if you are logged in as root, then it does not always show correctly.
    Try logging back in as yourself and then checking the classpah through the set command.
    Altrnatively, if this is not the problem, actualy try a reboot. which should not be necessary.
    best
    kev

  • Any Problem with my classpath?

    SET JAVA_HOME=C:\JDK1.4
    SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.4\BIN
    I have set the classpath in my windows ME os
    however I can successfully compile the java program but I can't run it, it gives the following error when using the command line java classname
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Is that any problems of my classpath???

    PATH is not CLASSPATH - they are different.
    The Windows path is a set of pointers that Windows uses to locate programs that you execute, like javac.exe and java.exe. This setting is explained here:
    http://java.sun.com/j2se/1.4.1/install-windows.html
    Scroll down to: 5. Update the PATH variable
    (you should have already done this as part of the Java installation)
    The CLASSPATH is another set of pointers that is used by Java to find the files that you create and want compiled and/or run. This setting is explained here:
    Setting the Classpath:
    http://java.sun.com/j2se/1.4.1/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.1/docs/tooldocs/findingclasses.html
    Examples:
    This is my path
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.1\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.1\lib\tools.jar;C:\NetRexx\NrxRedBk

  • Setting classpath in bat file

    Hi,
    I'm trying to call my java app from a bat file, normally I put all references to jar files hard coded in the bat file, but now I would like to loop over a lib directory and add all jars in that directory to the classpath:
    I tried the FOR loop of Windows batch like this:
    FOR /R .\lib %%G IN (*.jar) DO set CLASSPATH=%CLASSPATH%;%%G
    but the classpath only contains the last jar file of the directory, what is wrong with that line? A for loop on unix is no problem.
    THX

    Hi,
    I had teh same need, but neither
    FOR /R .\lib %%G IN (*.jar) DO set CLASSPATH=!CLASSPATH!;%%G
    works for me nor
    FOR /R .\lib %%G IN (*.jar) DO set CLASSPATH=%CLASSPATH%;%%G
    I have set the "ENABLEDELAYEDEXPANSION" also
    Regards

  • Set CLASSPATH does not work, how do I run java.exe?

    Hi guys,
    I have a problem running the java.exe and I'm using Win XP. Here is my problem:
    Under the command prompt, I set the path: path = C:\Program Files\Java 2\j2sdk1.4.2_05\bin
    Then I created a folder in E:\Hello. I save my Hello.java in that folder, and I compiled it:
    javac Hello.java
    Now, there is a Hello.class created in that folder.
    Then I try to run it: java Hello
    but I got an error: "Exception in thread "main" java.lang.NoClassDefFoundError: Hello"
    So, I try to set CLASSPATH, however, the problem remains, no matter how hard I try.
    Any ideas?

    None of the suggestion worked, I wonder why???
    Here is my location for the JDK:
    C:\Program Files\Java 2\j2sdk1.4.2_05\bin
    Here is my location for my Java project file:
    E:\JavaProject\Hello
    Here is the file name:
    Hello.java
    Here is the command prompt:
    C:\Documents and Settings\Alex Ngai> e:
    E:\> cd JavaProject
    E:\JavaProject> cd Hello
    E:\JavaProject\Hello> path = C:\Program Files\Java
    2\j2sdk1.4.2_05\bin
    E:\JavaProject\Hello> javac Hello.java
    E:\JavaProject\Hello> java Hello
    Exception in thread "main"
    java.lang.NoClassDefFoundError: Hello
    E:\JavaProject\Hello> java -cp Hello
    // Does not work, it lists all of the options for java
    E:\JavaProject\Hello> set CLASSPATH =
    E:\JavaProject\Hello
    CLASSPATH="C:\Program
    Files\Java\j2re1.4.2_04\lib\ext\QTJava.zip"
    E:\JavaProject\Hello> java Hello
    Exception in thread "main"
    java.lang.NoClassDefFoundError: Hello
    // I have tried a lot more, none of them won't work!!
    Now what should I try in the following command prompt?
    E:\JavaProject\Hello>Given the above there is only one possible explaination.
    You have a file named "Hello.java".
    In that file you have a non-public class which is NOT named "Hello". Instead it is named something like "HelloWorld" or even "hello" (case matters.)

  • Can't compile Servlet program(error in setting classpath in XP)

    I encountered a similar problem as 'hereispaddy'.
    "I have recently written a servlet program. When I compile the program (let's say "HelloWorld.java"), I've got the following error message:
    package javax.servlet does not exist
    I've download the class files and set the classpath already. Have I missed anything? "
    i would like to ask, how to set the following in Windows XP:
    set CATALINE_HOME=C:\PROGRA~1\APACHE~1.0
    set CLASSPATH=.;%CATALINE_HOME%\COMMON\LIB\SERVLET.JAR;C:\JDK1.4\BIN;
    *ive tried in control panel->system->advanced->environment variables->
    variable name:CATALINE_HOME
    variable value:C:\Program Files\Apache Tomcat4.0 (and)
    variable name:CLASSPATH
    variable value:.;%CATALINE_HOME%\common\lib\servlet.jar;C:\jdk1.4\bin
    but failed!
    Could anyone kindly tell me what's wrong with my setting?
    Thx a lot!!!

    Does Tomcat work? Can run the examples on the home page?
    The only suggestion I have at this point is to get rid of the spaces in
    C:\Program Files\Apache Tomcat4.0
    But I am still in Win98 , so I am just guessing.

  • Setting CLASSPATH's on Windows & Linux

    I am still new Java programming language, but I am coming along in learning the actually language. The one problem I keep running into is how to set a CLASSPATH on a windows machine and Linux machine. I have currently installed j2sdk1.4.2 on the windows machine and jdk1.5.0 on the linux machine. If any one has any suggestions on how to set these CLASSPATH's I would greatly appreicate it.

    Before ammending classpath I recommend checking the
    windows path variable. This variable is a list of
    folders where windows looks for executables.
    Path can be viewed by going to control panel ->
    system _> advanced table -> environmental variables
    and then selecting path and then edit.
    Make sure �C:\Program Files\Java\J2SDK1.5.0\bin� (or
    equivalent)is included.
    Alternative you can enter �path = %path%; �C:\Program
    Files\Java\J2SDK1.5.0\bin� into command prompt each
    session.
    This ensures that you can compile and execute java
    programs from any directory. Ideally the java
    installer should do it but I have found it does not.Indeed.
    Similarly the classpath can be varied from either the
    command prompt or it can be added to the
    environmental variables.I'm one of those that recommends folks not set CLASSPATH using an environment variable.
    IDEs like Eclipse and IntelliJ totally ignore it; so do containers like WebLogic and Tomcat.
    One CLASSPATH does not fit all. Every project is unique. The best way to set it is with the -classpath option on both javac.exe and java.exe.
    For compiling, you should learn Ant. It's a make tool built on Java and XML. That'll help with your compilation issues.
    For running, you'll either run in a container, which has its own idea of CLASSPATH, or you can script the startup of a batch job using a Windows .cmd or *nix .sh.  Set the CLASSPATH in the script.
    If altering it from the command prompt, in windows
    use a �;� between paths variables and a �:� for unix
    systems. Also include a �.� as one of the path
    variable as it includes the pre-existing class path.
    For example, when entered from the command prompt (in
    windows), the following line will add �C:\
    JavaPrograms� to the existing Classpath
    Java �cp .;C:\JavaPrograms
    Alternatively go into environmental variables as
    described above and if a classpath variable does not
    exist, create one and include �.� and your desired
    directory.
    Note: I prefer adding directories to the classpath
    via the environment variables as it is more accepting
    a folders with spaces in the name.Installing software in a folder with spaces in its name is asking for trouble. It's not highly recommended.
    %

  • Problems with Lightroom Library and Vista

    I have imported various photos in my Lightroom library but if I try to search some specific photos with the Keyword Tags or with Metadata Browser or also when I click on "All Photographs" to see all the photos together, no photo is showed on the grid.
    Does anyone know how to solve this problem? I have windows Vista; is it maybe a Vista bug?

    It's more likely that you have a filter set. Double check that, and you'll probably see the images.
    <br />
    <br />
    <span style="color: rgb(102, 0, 204);"></span>
    <font br="" /></font> color="#600000" size="2"&gt;~~ John McWilliams
    <br />
    <br />
    <br />
    <br />MacBookPro 2 Ghz Intel Core Duo, G-5 Dual 1.8; Canon DSLRs

  • Setting classpath within java application

    Hi
    Sorry if this question has already been asked, I've searched for it but couldn't find it.
    I've written a class (see below) that when given a directory will add all of the jar files to the classpath.
    The classpath is updated to include all of the jar files but if I try to use a class within one of these jar files then an exception is generated stating that the class can't be found.
    Can anyone help me with this problem? I thought that I would only need to update the classpath.
    Thanks,
    Rob
    public class Jar {
         public static void addJarsToClasspath(String root) {
              File f = new File(root);
              if (f.exists()) {
                   File[] jars = f.listFiles(new FilenameFilter(){
                        public boolean accept(File dir, String file) {
                             return ((String)dir.getName()+file).endsWith(".jar");
                   String classpath = System.getProperty("java.class.path");
                   for (int i=0; i<jars.length; i++) {
                             classpath = classpath.concat(":"+root+"/"+jars.getName());
                   System.setProperty("java.class.path",classpath);
                   System.out.println(System.getProperty("java.class.path"));

    You can do this with batch files in Windows NT/2000:
    1) create a batch file called "setcp.bat" containing the following:
    for %%i in (C:\myPath\*.jar) do call appendcp.bat %%i
    2) create another batch file called "appendcp.bat" containing the following:
    set CLASSPATH=%CLASSPATH%;%1
    Now you can run setcp.bat and it will add all JAR files in C:\myPath to your CLASSPATH.
    Jesper

  • Set classpath in JAXB - schemagen

    Using JAXB -(schemagen.bat) i need to create the .xsd file.
    To which , should i set the classpath.
    (TO schemagen.bat OR any-other jar file )
    After setting the classpath, how can i run it to create the .xsd
    (Is this the way???)
    c:\>schemagen MyJfile.java
    C:\jaxb-ri-20060801\bin>schemagen.bat
    When i do this it gives an exception like this -->
    Exception in thread "main" java.lang.NoClassDefFoundError: Files\Java\jdk1/5/0_0
    6\lib;/;F:\java\packages;C:\Program
    https://jaxb.dev.java.net/nonav/2.0.2/docs/schemagen.html

    The first major problem with the Runtime.exec() method is that path is obviously a variable and would need to be placed outside the quote marks: Process p = Runtime.exec("set classpath=" + path); Secondly this would only work under Windows, in Unix/BASH the command to set an environment variable would be export CLASSPATH=path.
    I had a similar problem two years ago, unfortunately I can't remember exactly how I did it, but I'm fairly certain it involved using the system properties of the System class. There is a system property called java.class.path, more info can be found in the API for the System class: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html
    Look especially at the methods getProperties() (contains a list of the system property names), and setProperty().

  • Set Classpath at runtime

    Hi everybody! I'm using NetBeans IDE 3.6 and I want to change the classpath at runtime. I�ve tried to make:
    set classpath="C:\Documents and Settings\Koening\Mis documentos\Proyectos";but it doesn�t recognize that sentence. If anybody knows how to change it at runtime please answer me.
    Thanks for the replies!!!

    I assume you were talking about a .bat file as you're writing that more or less in .bat format. The main problem if that's the case, is that you're not supposed to put quotes around the value:
    set classpath=C:\Documents and Settings\Koening\Mis documentos\Proyectos
    Actually changing the classpath at "runtime" (i.e., after the JVM is started) is more involved, and normally requires writing a launcher class which does nothing but create a URLClassLoader with the appropriate URLs, fetch the real main class from the new classloader, and executes its main method.

Maybe you are looking for

  • Macbook Pro Retina 15" 2014

    I have a MacBook Pro retina 15" 2014 2.3 ghz with 16GB of RAM memory. My laptop crashes and restarts at least once a day. I bought it two months ago. This is the report I got just now when it crashed for the third time today: Anonymous UUID:       BE

  • Can you click to enlarge an image in LiveCycle Designer?

    I am new to Adobe LiveCycle Designer, so forgive me if this sounds silly but is it possible to add an image to the form and have the ability to "click to enlarge" when viewing it as a PDF? Anything you can provide to guide me in the right direction w

  • Photoshop CS6 will not install: "The download appears corrupt... (-60)."

    "...Press Cancel, wait a few minutes and try again. (-60)" I've tried multiple times, but continue to get the same error.  I've been able to download and install Dreamweaver, InDesign, and Premiere Pro with any problems.

  • EyeTV keeps asking for admin login & password!

    I have EyeTV 3.1 installed into my iMac and, as my daily account is a standard user account, everytime I close EyeTV it asks for an admin login and password. How do I solve this please? Thanks in advance!

  • Configuration of Hotmail in MAC

    Could anyone help me in configuring the hotmail in MAC PRO. I am trying to set the mail by selecting the type as IMAP, the server is connecting to the microsoft properly but the mails are not syncing and they are taking longer time to sync. Can anyon