Classpath in Environment Variables

Dear All,
After I put " ; " in front of Environment Variables in Win XP System Properties
so my classpath=;C:\tomcat4\common\lib\servlet.jar;C:\tomcat4\webapps\aplikasiku\WEB-INF\lib\mssqlserver.jar;C:\tomcat4\webapps\aplikasiku\WEB-INF\lib\msbase.jar;C:\tomcat4\webapps\aplikasiku\WEB-INF\lib\msutil.jar. then my problem solved. I never found NoClassDefFoundError in my java.
Is it ok to use that classpath?
Thanks

Hi,
It can be used but should really really be avoided since it makes it makes it very hard to use when you have multiple applications, and applications of different versions.
Kaj

Similar Messages

  • Java classpath with Environment variable..

    Hi,
    I need to start an Java application with an Environment variable(EV) as class path.
    Ex:
    I have an EV APP_PATH =c:\myapp
    so i will give java -cp c:\myapp, instead of doing like this I need to give APP_PATH in the java -cp<EV>.
    I gave like this java -cp %APP_PATH% and that doesn't work...
    Is this the correct way or how to do this ?
    Thanks.

    I gave like this java -cp %APP_PATH% and that doesn't
    work...It does if APP_PATH has the correct value.
    Try echo %APP_PATH% and see if it's what you expect. They plug whatever that returns into your java command.
    Is this the correct way or how to do this ?That's the correct way. You APP_PATH must be wrong.

  • How to load a class , which isn't in the classpath environment variable.

    Hi, you folks.
    I have one problem. I want to load a class, which isn't in the classpath
    environment variable and I don't want to put into classpath. which method
    JVM can use to load it?
    Waitting for your sage advice.
    Regareds
    Hunter.Xiao

    You will have to write your own ClassLoader, or use something like URLClassLoader (I've never used this myself, but I've seen it mentioned elsewhere in this forum). Look here.

  • Environment variables like classpath,JAVA_HOME,path

    Sir,
    I work as a java developer in a software company.I had more problems when executing servlets."could not create the java vitual machine" error comes when i try to compile java servlet file.also I do not know that how to set environment variables like classpath,path and JAVA_HOME.Also I want to know them with proper examples.
    Thanking you.
    KRamesh

    Hi Teches
    I am facing few problem in starting eclipse 3.0 ; I had gone trogh forum , 1 of the persone suggest me to upgrade the java version.For this
    I had installed java 1.5 and set the following variable
    JAVA_HOME ---> to the home dir of JAVA
    PATH ---><home dir>/bin
    CLASSPATH --><jre>/lib
    But when ever i m giving "java -version" command on console , the result is as follows:
    C:\>java -version
    java version "1.3.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
    Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
    suggestion are welcome Plz.
    ;

  • Jar file doesn't read classpath environment variable from windows xp

    I created a small program that uses javamail and jdbc driver. I program on Win XP and use java 1.6.04.
    When I compiled my classes the program works fine but when I created a jar package the jar file cannot 'see' the classpath that windows has already set.
    I have to set the classpath in the manifest file and then it works ok.
    Is this normal? I was expecting that the jar file would work just fine without any complication since the classpath is already set in the system?
    If you could point to any documentation that covers this it would be great.
    Thank you very much.
    Genti

    genti_tech wrote:
    I specified the class-path in manifest in jar file and I looked at the tutorial you are suggesting:
    http://java.sun.com/docs/books/tutorial/deployment/jar/
    which is not clear at all about the fact that jar ignores the class-path environment variable.It is specified for java. http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html#-jar

  • CLASSPATH Environment Variable on Win2k problem

    hi
    i am new to java, but having problems to seting the CLASSPATH Environment Variable on my Win2k professional. my university computers are alredy set and i enjoy working with java. i just cant get my head arround to this problem. it would be much appriciated if some one send me a link which provide screenshot to resolve this problem. i got my jdk1.4 kit in a folder caled jdk in c:\ root.
    thanks

    Ashwani_Saxena wrote:
    Our application is stand-alone application and we are using Applet with Object Id tag for JavaScript to Java connectivity. In our application we are displaying the value of classpath environment variable on screen.
    Applets and stand alone applications are two different animals.
    While migrating from JRE 1.5 to JRE 1.6, we are unable to retrieve the classpath variable value. After analyzing, figure out that when classpath is defined in uppercase (i.e. CLASSPATH) then only we are unable to retrieve its value. However if its defined in lower case or any character is in lower case (i.e. classpath) then its value appears correctly. We are retrieving the classpath value via the "Set" command from Java.
    That's completely unnecessary, there's a System.getevn("CLASSPATH") method.
    However the CLASSPATH environmental variable isn't much use, and certainly not in the case of Applets, which definitely don't use it.
    Futhermore I don't expect the sandbox environment of an Applet will allow you to access the environmental variables in any way, (certainly not by running a program). Applets, unless signed, have almost no access to the client machine they run on.

  • CLASSPATH environment variable - Pro/cons?

    I was told that its not a good idea to define CLASSPATH as a system environment variable, but was never told why. Is it correct that it should be avoided to define CLASSPATH as a system variable?
    Another thing when should a variable be defined as a system variable or an user variable?

    fedevaps wrote:
    I was told that its not a good idea to define CLASSPATH as a system environment variable, but was never told why. Is it correct that it should be avoided to define CLASSPATH as a system variable?For one thing, it means you have no control over classpaths. Say you write two apps, and they each use a different version of the same library. If you're using the one global classpath for both of them, you're stuffed. How do you allow them both to use the correct version? Then you come to deploy one of them on someone else's machine, and, say, send them a CD with it on."Right, what jars does it use again? I dunno. It always just worked, cos I've got all my dependencies in one place, and the VM picks up the lot. Goddammit. I'll have to put all of them on his machine, too .AND set up his classpath. What? There are 500 machines to roll out to? And some of them don't even +have+ that folder? Goddammit! ". See the problem? If you explicitly dictate a classpath when starting up the JVM, it can be wherever you want - typically a lib folder within that specific app - and have exactly what you need on it. Much more flexible and easier to control
    Another thing when should a variable be defined as a system variable or an user variable?I hope you're just asking cos you're already here, and not because you think this is related to Java. Cos it isn't. System variables are available to, well, all the users of the machine, including any local accounts that services might be running under. A user variable is specific to the user it's defined for, and not visible to any others. When you use which depends very much on what the variable is for

  • OC4J classpath & environment variables

    Hi,
    What do I have to have in my classpath?
    What environment variables I need to have?
    Do I have to install JDK X.XX before I install OC4J or does OC4J comes packaged with a JDK?
    Thanks
    Nabil

    I think you should install JDK1.2.2_07 or 1.3.x before you install OC4J. I am using JDK 1.3.1 now. I had used JDK 1.2.2_05 and _08, but when I start OC4J, there was a NON-FATAL error message. Although it's NON-FATAL, I still don't like it. So I moved to JDK 1.3.1. My classpath in system environment variable is ".;", nothing else.
    But if you are going to use OCI8 JDBC driver,
    you'd better replace the classes12.jar under OC4J\lib with classes12.zip coming with Oracle8i Client 8.1.7.3. otherwise, you will encounter an "UnsatisfiedLinkError" when you use the datasource to get connection. In addition, you should set the "path" variable in order to run Oracle8i client. You can find the information from Oracle8i'd documentation.
    Good Luck!

  • Error in setting environment variable

    hi
    Please note JKit is where my jdk1.3 is stored(i.e instead of jdk1.3 folder its JKit folder)... i have gone thru the similar threads but with no success.
    SET
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;D:\Jkit\bin;D:\Jkit\lib;D:\Oracle\bin;"C:\PROGRAMFILES\ORACLE\JRE\1.1.7\BIN";D:\JKit\Jre\Bin;
    SET PATH=%PATH%;C:\PROGRA~1\COMMON~1\AUTODE~1;
    SET CLASSPATH=c:\JavaWebServer2.0\lib\servlet.jar;c:\JKit\lib;
    SET CATALINA_HOME=D:\tomcat\jakarta-tomcat-4.1.29;
    SET JAVA_HOME=D:\Jkit;
    The error i get after running autoexec.bat and then tomcat/bin/startup is as follows..
    The CATALINA_HOME environment variable is not defined
    This environment variable is needed to run this program
    please HELP!!.THANKS

    Hi
    Very many thanks for ur solution.. i actually hadset the environment variables spacce..but when i execute the autoexec.bat file i dont get any error(out of env space)..but when i run the startup.bat file i get from the command prompt, i get the foll error.
    This is my Autoexec.bat
    SET JAVA_HOME=D:\Jkit\bin
    SET CATALINA_HOME=D:\tomcat\jakarta-tomcat-4.1.29\bin
    SET PATH=D:\Jkit\bin;C:\WINDOWS;C:\WINDOWS\COMMAND;
    SET PATH=%PATH%;C:\PROGRA~1\COMMON~1\AUTODE~1;
    THE FOLLOWING IS THE ERROR I GET WHEN I RUN STARTUP.BAT UNDER TOMCAT'S BIN UNDER THE COMMAND PROMPT
    D:\tomcat\jakarta-tomcat-4.1.29\bin>startup
    Syntax error
    Out of environment space
    Out of environment space
    Out of environment space
    Using CATALINA_BASE: D:\tomcat\jakarta-tomcat-4.1.29
    Using CATALINA_HOME: D:\tomcat\jakarta-tomcat-4.1.29
    Using CATALINA_TMPDIR: D:\tomcat\jakarta-tomcat-4.1.29\temp
    Using JAVA_HOME: D:\Jkit
    Out of environment space
    Out of environment space
    Invalid switch - -DJAVA.ENDORSED.DIRS=D:\TOMCAT\JAKARTA-TOMCAT-4.1.29\COMMON\ENDORSED
    I even set JAVA_HOME AND CATALINE_HOME to the \bin dir respectively..
    still i get the same error
    As given under the tomcat installation documentation (RUNNING.txt), i set the space for environment space under the Memory tab, for startup and shutdown.bat files, it creates a shortcut for running the resp .bat files, running startup.bat file i get,CATALINA_HOME VAR HAS NOT BEEN SET PROPERLY, THIS OCCURS FOR BOTH TOP LEVEL DIR SETTING AND /bin DIR SETTING of CATALINE_HOME IN autoexec.bat
    PLEASE HEL, I HAVE BEEN TRYING TO CONFIGURE IT FOR THE PAST DAYS BUT WITH NO SUCCESS, DONT KNOW WHERE I AM GOING WRONG..PLEASE HELP

  • Open module for managing property file and environment variables

    Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
    Any ideas are greatly welcomed.

    You seem wright, you hit a brick wall here with Air to find the location
    of the command console on windows...
    So in fact I never build an exe tool, but this little problem was a nice
    case to test it and I tried it.:
    I downloaded monodevelop
    -GTK# for .NET 2.12.10*
    -MonoDevelop 2.4.2*
       from http://monodevelop.com/Download
    created a console project and had an exe in 5 minutes !
    You can download the findconsole tool and the projectfiles here:
       http://greencollective.nl/temp/dump/findconsole_monoproject.zip
    findconsole.exe will reveal the path/location of cmd.exe on a windows system.
    Cheers,
    Latcho

  • Conversion Agent Environment Variables.

    Hi Experts,
    We are using on Conversion Agent for converting EDI file data into XML.
    Using Parser for this.
    The problem is related to Enviornment Variables to be loaded on XI Server.
    What will be the environment variables for this purpose and what will be the value for the same.
    I have loaded three Environement Variable on XI Server for Conversion Agent,
    1. CLASSPATH  -  C:\Program Files\SAP\ConversionAgent\api\lib\CM_JavaAPI.jar
    2. IFCONTENTMASTER_HOME - C:\Program Files\SAP\ConversionAgent\
    3. Path - C:\Program Files\SAP\ConversionAgent\bin
    Are these entries correct ? Please help.
    When I am using
    To use the remote support interface:
    1. In Microsoft Internet Explorer, version 6.0 or higher, browse to
    http://HOST:PORT/CMViewer
    Selecting Event : View Initialization Events, it is giving me an
    error : Event file not found!
    Selecting Event : View Execution Events, it is not showing any Date in
    Date field and not showing any service in Service Field and Next
    Pushbutton is also disable.
    What is the problem ? Please help.
    Regards,
    Study SAP.

    Yes it shows up after restart of BIDS .
    But during design time this is a bug I hope Microsoft fixes this bug in the future releases
    Mudassar
    It's not really a bug. Visual Studio loads the environment variables when starting up.
    In future releases you use projects and parameters instead of environment variables, so the issue goes away ;)
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • Setting JAVA_HOME environment variable?

    Sorry for such a trivial question, but in Windows 2000 Server with Microsoft Visual J++ 6 and the JRK 1.1.8, can somebody tell me what the environment variables should be so that I can use this jdk? If not can you tell me what your environment variable JAVA_HOME points to?
    And one last question if it's not too much to ask. Can you tell me the NNTP server address for SUN so that I can go to the newsgroups in my News reader rather than over the web?
    Thanks.
    George Hester

    Thanks. I have a problem though. I installed the jdk 1.1.8 because I heard that was the last one supported using Visual J++. Hence I have a C:\jdk1.1.8. This folder has no JRE subfolder so I am stuck at what you said the Classpath should contain as the path\folder you say it should be does not exist.
    I have a folder C:\Program Files\JavaSoft\JRE\1.3.1 which has the lib folder containing rt.jar.
    So as you can see I'm sort of in a quandry.
    If I make JAVA_HOME as you say then it does not contain the JRE. If I make JAVA_HOME C:\Program Files\JavaSoft so that your suggestion for Classpath is correct that folder does not contain the jrk and it seems that I will not be using it.
    Any suggestions how to set this up so that it's right?
    George Hester

  • Problem with environment variable & compiling

    G'day all,
    I'm totally confused :(
    I've set my environment detail but when I use javac the command window just does nothing. The cursor (or flashing thingo) drops to the line below and just hangs there. If i manually type in the entire path javac works fine.
    Image of my environment variable window is here:
    http://img130.imageshack.us/img130/5120/environvariables.jpg
    Using Windows 7, JDK 1.6.0_18 and latest version of Eclipse is installed.
    Second issue:
    I wrote a program using Eclipse. It all went into a package named "openagil". 3 classes in total. Class "A", "B", "C". A uses both B and C. It creates an instance of B and C. Included in each is package openagil; at the very top.
    Running in eclipse it works fine. However, how do I compile this using javac and then in turn run it? The .java files are located within a workbench folder (java) and then in the package directory (openagil). These are contained on the D drive so "d:\java\openagil" - No class variables are set as I am unsure how this is done (despite reading a few guides).
    I can do javac d:\...*.java and it'll compile all of them fine but I am then unsure how to run it. I think what I do is do java openagil.classA but this pulls up errors - an "exception in thread' error followed by a "noclassdeffound: openagil/classA" then a whole bunch of URL/Access Controller stuff.
    I understand programming fine, but configuring this is a bitch. My Java book doesn't cover installation nor does it cover packages and the

    LordMidol wrote:
    Second issue:
    I wrote a program using Eclipse. It all went into a package named "openagil". 3 classes in total. Class "A", "B", "C". A uses both B and C. It creates an instance of B and C. Included in each is package openagil; at the very top.
    Running in eclipse it works fine. However, how do I compile this using javac and then in turn run it? The .java files are located within a workbench folder (java) and then in the package directory (openagil). These are contained on the D drive so "d:\java\openagil" - No class variables are set as I am unsure how this is done (despite reading a few guides).
    I can do javac d:\...*.java and it'll compile all of them fine but I am then unsure how to run it. I think what I do is do java openagil.classA but this pulls up errors - an "exception in thread' error followed by a "noclassdeffound: openagil/classA" then a whole bunch of URL/Access Controller stuff.You need to us the -classpath (or -cp) command line option to specify where java looks for your .class files. I think it would be java -cp d:\java openagil.classAFYI class naming convention is to start with a capital letter - YourMainClass for example. It may help to go here [http://java.sun.com/javase/6/docs/technotes/tools/index.html] and go to General Information, then click on How Classes Are Found.

  • Using environment variables in the JAR manifest

    Hello,
    I need to make a JAR which uses some third party libraries located in the file system, in a path referenced through a environment variable (named for example ENV_VAR). Without using the JAR the application may be started by running:
    java -classpath %ENV_VAR%\lib\library1.jar;%ENV_VAR%\lib\library2.jar MyApplication
    So what is the syntax to refer to environment variable inside the manifest?

    I guess its not possible. If you look at the [Manifest specification|http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest] there is nothing that inidcates that environment variables can be used. The classpath attribute is specified as follows:
    The value of this attribute specifies the relative URLs of the extensions or libraries that this application or extension needs. URLs are separated by one or more spaces. The application or extension class loader uses the value of this attribute to construct its internal search path.
    So actually, if it would be possible the ENV_VAR pathes must be set relative to your application .jar file.
    Why not just use a batch that sets up your command line as in the example and runs your app?

  • Who can tell me the details about "JMSJVMOPTS" environment variable of JMSC API

              I have a question about JMS C API.
              When in windows service application, JMSContectCreate return JMS_JVM_ERROR error.
              But in desktop app, it does well.
              I think I may need set the JMSJVMOPTS environment variable.
              But how to set JMSJVMOPTS ?
              

    OK,
              The JMSJVMOPTS are extra options passed to the "java" executable itself
              along with
              "-Djava.class.path=${CLASSPATH}"
              Hence, the actual things you can set with this depend on which java compiler
              you are using. If you are using the Sun JVM for instance, here are some of
              the options you can set (from java -?)
              where options include:
              -client to select the "client" VM
              -server to select the "server" VM
              -hotspot is a synonym for the "client" VM [deprecated]
              The default VM is client.
              -cp -classpath <directories and zip/jar files separated by ;>
              set search path for application classes and resources
              -D<name>=<value>
              set a system property
              -verbose[:class|gc|jni]
              enable verbose output
              -version print product version and exit
              -showversion print product version and continue
              -? -help print this help message
              -X print help on non-standard options
              -ea[:<packagename>...|:<classname>]
              -enableassertions[:<packagename>...|:<classname>]
              enable assertions
              -da[:<packagename>...|:<classname>]
              -disableassertions[:<packagename>...|:<classname>]
              disable assertions
              -esa | -enablesystemassertions
              enable system assertions
              -dsa | -disablesystemassertions
              disable system assertions
              As far as what sort of things can cause a JMS_JVM_ERROR from
              JmsContextCreate the answer is that there are many, many reasons this might
              be happening. Please look for a file named ULOG.<mmddyy> (where mmddyy is
              month/day/year - for example ULOG.081403) somewhere on your system (I am not
              sure where this file would go being run from a W2K service). That "userlog"
              file should contain more information about why the failure occurred.
              Also, you can set JMSDEBUG=y in your environment which will print to stdout
              (again, not sure where stdout goes in a system service) stack traces and
              other debugging information into the ULOG file.
              Hope this helps...
              "Luke" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,John Wells,
              > thanks for your help.
              > But what I really don't know is what value I can set for JMSJVMOPTS.
              > There is not document about the detail of optional values for JMSJVMOPTS.
              > And what reasons can result a JMS_JVM_ERROR in JmsContextCreate() ?
              

Maybe you are looking for

  • Important!! Improve the life and performance of the battery.

    Reduce the operating temperature and increase battery life The battery in your notebook PC is designed to provide the necessary amount of energy for the processor while maintaining HP high safety standards. As a result, the battery may not charge or

  • Alert for adapter engine error

    Hello experts We have configured the alerts for the adapter engine errors .We have configured the variable &SXMS_TO_ADAPTER_ERRTXT& element which is having the CHAR70 type for getting the adapter engine error text in the alert inbox.so for any adapte

  • Paging in PDF previews

    The SWF preview of multi-page PDFs isn't behaving as I would expect for simple online viewing. Specifically, if you launch a preview of a multi-page PDF doc, and scroll down to the bottom of the page, all is as expected. You can't (as you would in Re

  • HT1600 can you download apps to apple tv

    can you buy apps for apple tv like the channels on a roku?

  • Error In QM01

    Hi, i have a quality notification order, with status (COMPLETE, ALL MATERIALS ARE COMPLETE and the DELETION FLAG was SET). it has a reference document with inspection lot, and when see the amount in the QN and inspection lot is 100 and looking at the