How to set classpath in WinXP Home edition

Hello everyone,
Recently I have try to run the HelloWorld java code, but it come up with a error. (Exception in thread �main� java.lang.NoClassDefFoundError: HelloWorld)
Java programming Code:
public class HelloWorld {
public static void main (String args[]) {
System.out.println("Hello World!");
I also try to compile another simple program, and it come up with the simpler error, (Exception in thread �main� java.lang.NoClassDefFoundError: Add16And23)
Java programming Code:
public class Add16And23
     public static void main (String[] args)
          int sum;
          sum=16+23;
          System.out.println("The sum of 16 and 23 is " + sum);
HOW CAN I FIX THIS, I read other threads before, it say some about class path.
Do anyone know how to set it, in winXP?
Do anyone know the whole path that I should put in, in winXP?
What should I type in the (User variables for windows) and (System variables).
I have :
* (j2eesdk-1_4-dr-windows-eval) downloaded and installed;
*WinXP Home edition Version 2002 Service Pack 1
* My current Java path are (C:\Sun\AppServer\jdk\bin) in the (User variables for windows).
Please help!!!
Thank you all!!!

I'm also windows xp.
fllowing example:
java_home=c:\j2sdk1.4.2_03\bin
classpath=c:\j2sdk1.4.2_03\dt.jar;c:\j2sdk1.4.2_03\tool
.jarThis won't fix a thing.
When you run, do it like this:
java -classpath . HelloWorldNote the "dot" after -classpath. That tells the class loader to look in the current directory for the .class files it needs.
Read about how to run the javac.exe and java.exe tools in your javadocs. You'll have to learn about CLASSPATH. - MOD

Similar Messages

  • In UNIX how to set classpath

    I know nothing about UNIX. pls kindly give me some instruction on how to set classpath in UNIX, thanks!

    best way is to set in your .profile (name differs between different shells, but whatever the OS/Shell is, it should starts with . and has a 'profile' string in the name). Try ls -a to find the file, edit it, insert lines like this:
    CLASSPATH=xxxx
    export CLASSPATH
    Use : to seperate different path/files.
    then every time when you log in, the classpath is setted.
    if you already logged in, use the above lines in command line, but it only set class path of the current shell/console.
    anyway, you should learn Unix before you do anything, or you'll have more trouble. do a search in yahoo or google to find on line tuturials, and SUN's Java tuturial has some basic instructions on how to use Java in Unix.

  • How to set Classpath for MySQL

    Hi
    I want to connect to my mySQL db with a java program , but I don't know how to install the mySQL connector driver. Can anyone help me? or indicate somewhere where I might find the answer?
    And how to set Classpath for MySQL.
    my program gives an exception ClassNotFound.
    Exception :com.mysql.jdbc.Driver
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at Files.main(Files.java:352)
    Plz help me
    Thanx
    Lalit

    to make your life easy i tried to connect..
    what you have to do is.. you mysql database server should be running
    next you have to download one of the version of mysql driver.. i downloaded mysql-connector-java-5.0.5
    go to my computer right click - >advance tab -> click on environment variable -> put you path e.g. C:\Program Files\Java\jarFiles\mysql-connector-java-5.0.5\mysql-connector-java-5.0.5-bin.jar
    into your classpath in a user variable section..
    Try this code
    import java.sql.*;
    public class MySqlConnect{
         public static void main(String [] args){
              try{
                   Class.forName("com.mysql.jdbc.Driver");
                   String url ="jdbc:mysql://localhost:3306/test";
                   Connection con =DriverManager.getConnection(url,"root", "password");
                   System.out.println("Connection: " + con);
              }catch(ClassNotFoundException cnfe){
                   cnfe.printStackTrace();
              }catch(SQLException se){
                   se.printStackTrace();
    }have fun
    Gurnah

  • Running on WinXp Home Edition?

    Hi, i'm currently using Forte for Java Internet Edition 2.0 to develop a web application. It runs well on Windows2000 Professionla and Server Vesion. But it has several errors when i try to run it on WindowXP (both are server side, not client side). The Tomcat and MySQL is well implemented. The errors i get are something like one or more of my functions got problems.
    Can anyone tell me what's wrong with the web application? and Can winXP run JSP-based web application as server side?
    Any feedback is greately appreciated.
    Thanks in advance.
    Regards,
    Jacky

    On Win2k:
    Web Server:Jakarta-Tomcat-3.2.3
    JVM: JDK1.3.1
    IDE: Forte for Java, Internet Edition 2.0
    Database: MySQL 4.0.0 alpha-nt
    MySQL Driver: MySQL Connector 3.0 Beta version
    Browser: Internet Explorer 5.0
    On WinXP
    Web Server:Jakarta-Tomcat-3.2.3
    JVM: JDK1.3.1
    IDE: Forte for Java, Internet Edition 2.0
    Database: MySQL 4.0.0 alpha-nt
    MySQL Driver: MySQL Connector 3.0 Beta version
    Browser: Internet Explorer 6.0
    The web application that i designed is fine when running on Win2k, but return erros when executed certain procedures/functions.
    Further question: Can winXP home edition support JSP? or JSP is well supported only by winXP professional ? Please advice.

  • How to set classpath from java class ??

    I have tried to use System.setProperty("java.class.path", "my class path string ") to set classpath dynamically. But it is not working. How to set it dynamically from java class ?? Thanks , gary

    Look into the java.net.URLClassLoader. You can't set the classpath after the fact but you can specify URL's that will checked when you try to load a class with that loader.

  • How to Set CLASSPATH in Apache Web Server Using IAS

    Hi,
    I have problem setting the classpath for the servlet I am using for file uploading...My work environment is Web Server is Apache with Oracle8i IAS on Sun Solaris..
    I have tried various method like setting wrapper.classpath=/oracle/ias/Apache/Jserv/servlets and my class resides under /oracle/ias/Apache/Jserv/servlets/com/oreilly/servlets/MultipartRequest.class
    in the Jserv.properties, still it get the error message class ...not found in type declaration when I compile the code...my reference to the servlet in my JSP code is com.oreilly.servlet.MultipartRequest ..
    Can someone help me out please, if you have have any idea of how to set the class path with the working environment I have specified ealier....
    null

    have you posted this on the ias 9i forum where the ias 9i apache experts are at ??

  • How to Set a page as home page in Oracle portal 10g

    Hi,
    I have one doubt.
    How to set a page (Not Page group) as home page in Oracle portal 10g?
    whether it should be a HTML Portlet or some other?
    Thanks & Regards
    Suthan.Sathya

    Hi,
    Welcome to SDN
    By defining the Sort Sequence of Navigation Nodes, you can do this, check the links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/92/3e703e632c7937e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/53/89503ede925441e10000000a114084/frameset.htm
    If you need more help, just ping back.
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

  • I dont know how to set a site setup and edit some ready html files

    how to set up a site in dreamweaver when using a WAMP SERVER and edit some html files

    Is it a PHP or ASP site or does it have SSI components?
    If not you don't need to seet up a server. You can preview pages offline in a browser window.
    If it IS a PHP, ASP or SSI site, you need to copy it (the site folder)  to your "www" folder of the WAMP folder and then define the site using the folder you placed in the "www" folder as the root.

  • I don't understand some of the termology is that a detailed step by step description on how to set firefox as my home page

    I want to fax firefox as my home page. How do I accomplish this?

    Are you referring to this support article?
    * https://support.mozilla.com/kb/How+to+set+the+home+page
    Which steps do you not understand?
    You can set the page in the current tab as only home page if you drag the tab or icon (website's favicon) that you see on the left hand side of the location bar or the toolbar Home button that has been moved to the far right of the Navigation Toolbar.
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily if the Menu Bar is hidden.
    * https://support.mozilla.com/kb/Menu+bar+is+missing

  • How to set classpath for J2ME

    how to set class path for j2me. I downloaded J2ME Wireless tool kit. And set the classpath "set classpath=c:\J2mewtk\lib\midpapi.zip;.;". but i could compile java file. .how to set.
    With regards
    Santhosh

    When you are downloading j2MEWTK, everything is included within it. You dont require MIDP seperately. When you are runnung the ktoolbar , which is provided with J2mewtk, the preverifier runs and creates the required jad file for you. You dont need a forte to run these.
    If you want to download MIDP seperately, that also is possible. Then you have to go for command line arguments. Please refer to Sun's MIDP page for details.
    Let me know, if you face any further problem

  • 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

  • How to set classpath to use imported packages?

    Hi all,
    a real newbie question:
    I have created a class in which i import the java.io package. I can compile this class with the Oracle JDeveloper IDE (this is a variation on JBuilder).
    The problem is that i can't run this class because (most probably) the java.io package is not in the class path.
    Which jar file should i include in my classpath?
    jdk1.3\src.jar
    or jdk1.3\lib\tools.jar
    or jdk1.3\lib\dt.jar
    or ...
    Where can i find information on this? How can i find structure in the jungle of classes and packages?
    thanks, Bart

    If you want to execute this class file there are two ways you can do this:
    First set your environment PATH:
    Second you can explicitly state the classpath: for example
    change to the directory with the class file:
    cd c:\progra~1\Oracle\JDEVEL~1.0\MYCLAS~1
    while in the directory type
    java -classpath c:\progra~1\Oracle\JDEVEL~1.0\MYCLAS~1 HelloWorld
    Hope this helps.

  • How to set classpath for classes in war files

    Hi All,
    After deploying the WAR file I could access the JSP files but gives classnotfound exception when the information is expected from the java servlet.DO I need to set the classpath if yes how to do for the war file.
    thanks

    The web.xml,file structure and error is below let me know if more information is required.
    As you said weblogic is looking for the classes in lib directory inspite of having the classes in web-inf/classes directory.
    web-app>
    <servlet>
    <servlet-name>ControllerServlet</servlet-name>
    <servlet-class>com.test.site.pds.Controller</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ControllerServlet</servlet-name>
    <url-pattern>/controller</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    File Structure:
    C:\test\PDSWebApp\WEB-INF\classes\com\test\site\pds\*.class
    PDSWebApp
         css
         html
         images
         javascript
         jsp
         WEB-INF
         classes
         com/test/site/pds/*.java
         lib
         servlets
    The error:
    javax.servlet.ServletException: [HTTP:101249][ServletContext(id=18129862,name=PdsApp,context-path=/PdsApp)]: Servlet class com.test.site.pds.Controller for servlet ControllerServlet could not be loaded because the requested class was not found in the classpath C:\bea\user_projects\domains\mydomain\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\PdsApp.war;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\WEB-INF\lib\classes12.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\WEB-INF\lib\commons-beanutils.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\WEB-INF\lib\commons-collections-2.1.1.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\WEB-INF\lib\commons-lang-2.0.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\WEB-INF\lib\displaytag-1.0.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\WEB-INF\lib\jstl.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\WEB-INF\lib\standard.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp\jarfiles\_wl_cls_gen.jar;C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_PDSAPP_PdsApp.
    java.lang.ClassNotFoundException: com.test.site.pds.Controller.

  • How to set new tabs to home page when opened

    I have no problem setting up my home page, but new tabs open as blank pages. How do I set up Firefox to open new tabs to my home page, when I manually open a new tab?

    "Donations" to add-on developers are not required. Add-on developers do appreciate donations from users since they devote their time and efforts '''''free of charge''''' to develop the add-on(s). Donations also help pay for costs incurred in operating a website and some have online help forums to help their users with support questions.
    Tab Mix Plus is a great add-on, I use it and like it, but it is a bit "heavy"/large to install for just that one function. Tab Mix Plus performs many functions related to tabs and has many, many options that you can set related to tabs, including the one that your requested.
    <u>An add-on that is much smaller and is designed to perform that one function</u>, opening a tab with the page you specify, is New TabURL:
    *New TabURL: https://addons.mozilla.org/en-US/firefox/addon/newtaburl/
    *After installation and restarting Firefox
    *#Open the options (Add-ons > Extensions, click Options next to New TabURL)
    *#Set your options and/or enter the URL you want to open in new tabs
    *#Click "Save"
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • How to set classpath to take classes in conf \ jboss.service.xml file

    Hi,
    I just want to put some classes which are in a package say 'mypack' in the lib folder . In the jboss.service.xml file the classpath is set to codebase="lib" archive=" * " > but this won't work for classes which are not in any of the jar files. how to do this?.. pls help me.
    Thanks in advance
    Sudheer

    Could you package your classes into a jar file?
    Fil

Maybe you are looking for

  • How to make "More Products" from Answers visible

    I am using OBIEE 10.3.4.2. I developed a solution that requires "Delivers". On my developers' box (Windows 7) everything is visible. Under "More Products", I see: Delivers BI Publisher Marketing Disconnected Analytics and Download Oracle BI for Micro

  • Itunes Not verifying IPod Classic

    I am trying to sync my Ipod, and for some reason Itunes isn't verifying my Ipod, thus making it impossible to sync the content of my computer. This is the first time it has ever done this. In the top box, it is saying, and has been saying for a while

  • How do I get the copyrights to a song that I purchased:

    I purchased a song on itunes but I need the rights to the song in order to use it for the purpose that I boight it.  How would I go about doing that?

  • 401 Unauthorized Error when Registering Workflow Manager

    I have installed the workflow manager successfully. However, when I try to run Register-SPWorkflowService I get a 401 Unauthorized error. I am running SharePoint 2013 Management Shell as administrator. When I use internet explorer to browse to https:

  • How do I clear updated apps from Updates Screen

    Once I have updated my apps how do I clear those updates from the screen.  Currently I see the updates I made 9/26/13, 9/25/13, 9/22/13, 9/20/13. Once I have updated teh apps I no longer need to see that I updated them. Russell Bell