Cannot run .class file.  What's wrong, please?

Hi,
I have installed J2SDK1.4.2_03 in D: drive in folder JavaApplications.
Have appended the path: ;D:\JavaApplications\bin in System Variable.
Written a simple program named WhatIsYourName.java and saved in D:\JavaPractices
At D:\JavaPractices> compile the program using javac WhatIsYourName.java and it is OK
At D:\JavaPractices> checked directory and the WhatIsYourName.class file is there.
When typed: java WhatIsYourName
Error message appears:
Error: could not open C:\Program Files\Java\j2re1.4.2_03\lib\i386\jvm.cfg
Reinstalled J2SDK1.4.2_03 in D: drive in folder JavaApplications again, same error.
When I checked the C:\Program Files, there is a bin and lib folders residing in a 1.3.1_07 folder in the JRE folder. The JRE folder is found in a folder called JavaSoft. Is it because of this that the error occurred?
Could not understand why?
Please help.
Thank you very much.
Theophilus

Hi ChuckBing,
You are right. The older version is being found first. After removing the older version I can run the .class file.
Need to ask you about checking the full path when invoking java which you suggested. At D:\JavaPractices directory am I supposed to type \JavaApplications\bin\java WhatIsYourName ? I don't quite get what you mean.
Thank you very much.
Theophilus Mah

Similar Messages

  • I can compile java, but I cannot run class file.

    Exception in thread "main" java.lang.NoClassDefFoundError: Demonstrate
    That is the error I get when I type: java Demonstrate
    I have "C:\j2sdk1.4.0\bin" in the path for the Environment Variables in windows xp. I've even tried to insert that into a CLASSPATH several ways and it does not change the error.
    javac Demonstrate.java works fine. That compiled file can work on other computers. Because of that, I do not think it's a setting error. Any ideas ? Thanks for any help.

    Microsoft problem? I like nothing better than bashing M$, but this sounds like a CLASSPATH problem to me.
    I'll assume that your Demonstrate.java does NOT have a package statement in it and has a main method that you'd like to run. If so, you compile like this:
    javac Demonstrate.javaThe result is a Demonstrate.class file in the same directory as Demonstrate.java.
    Now, type this in the command shell right in the directory where Demonstrate.class lives to run it:
    java -classpath . DemonstrateYou won't get that ClassNotFoundException.
    Whenever you see that exception, it means you don't have your CLASSPATH set properly. - MOD
    You won't get ta

  • Cannot write class file...

    I have no idea what this means. This app was running just
    fine. Then wham.
    Here is the error message:
    Errors reported by Java compiler: Found 1 semantic error
    compiling
    "D:/CFusionMX/wwwroot/WEB-INF/cfclasses/cfApplication2ecfm855244706.java":
    1. public final class cfApplication2ecfm855244706 extends
    coldfusion.runtime.CFPage{ <-------------------------> ***
    Error: Cannot write class file "cfApplication2ecfm855244706.class"
    because that name conflicts with the name of the class file
    "cfapplication2ecfm855244706.class" in directory "cfclasses". This
    is illegal because file names are case-insensitive in this system.
    If anyone can tell me where to look and what to do here, I
    would be very grateful.
    Thanks,
    Lee

    Try clearing out your cfclasses directory which is located on
    your machine at D:\CFusionMX\wwwroot\WEB-INF\cfclasses. Then
    restart CF.

  • My Canon 5D Mark 3 camera..I cannot download Raw files using iPhoto help please

    Canon 5D Mark 3 I cannot download Raw file in iPhoto help please?

    You will need OS X 10.7.4 and iPhoto 11 or Aperture 3 for this.
    What do you have?

  • How to run .class file and .jar file in jdev9i

    I want to run .class file and .jar file in jdev9i,what should I do?
    Also,I want to generate .class file and .jar file in jdev9i,what should i do?

    Add the .class file containing the public static void main(...) method to the project by clicking on the + toolbar button in the navigator, open the project properties and properly set the additional classpath then right click on the .class in the navigator and say run. It should work, I've just tried it.
    Doesn't work for a .jar yet, in JDeveloper 9.0.3 it works both for .class and .jar
    Michel

  • Cannot running the file suddenly

    i can run any file before, but i dont' know why i cannot run the file suddenly. i just running a simple file as follow:
    public class h {
    public static void main(String[] args) {
    // Display "Hello World!"
    System.out.println("Hello World!");
    i compile file successfully, but when i run the file , it display the following error:
    Excepting in thread "main" java.lang.NoClassDefFoundError: h

    bet your h.class file is not in classpath.

  • Running class files from the windows command line...

    Hello Everyone,
    My instructor showed us a way to run class files from the windows command line. However every time I try to run the class file from the command line using a command like: java CruiseHelper.class
    I get an error that states "Exception in thread "main" java.lang.NoClassDefFoundError: CruiseHelper/class"

    Hello Everyone,
    My instructor showed us a way to run class files from
    the windows command line. However every time I try
    to run the class file from the command line using a
    command like: java CruiseHelper.class
    I get an error that states "Exception in thread
    "main" java.lang.NoClassDefFoundError:
    CruiseHelper/class"Classes are not file names. You don't have a class named "CruiseHelper.class", that's a file name. The class name is just CruiseHelper (if you have no package statement in it).
    So,
    java -classpath . CruiseHelper

  • HT4059 When I tap on the store on my iBooks it says cannot connect to iTunes, what is wrong?

    When I tap store on my iBooks it says cannot connect to iTunes, what is wrong?

    Hi Kath50OCD,
    Thanks for the question. When troubleshooting iTunes Store connection issues, the following articles provide the best information:
    First, try signing out of your account in Settings > iTunes & App Store. Once signed out, go ahead and sign back in.
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/HT1311
    If the above did not resolve your issue, refer to the following:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    If you haven't been able to connect to the iTunes Store:
    - Make sure that your iOS software is up to date by connecting your iOS device to iTunes and clicking on Check for Update in your device's Summary page in iTunes.
    - Check and verify that you are in range of a Wi-Fi router or base station. If you are on a 3G capable device, make sure that cellular data is turned on from Settings > General > Cellular.
    - Check to make sure you have an active internet connection. You can check the User Guide for your device for help with connecting to the internet.
    - Check to make sure other devices (portable computers, for example) are able to connect to the Wi-Fi network and access the internet.
    - Try resetting (turning off and then on again) your Wi-Fi router
    - If the issue still persists see, iOS: Troubleshooting Wi-Fi networks and connectionsoriOS: Troubleshooting Wi-Fi networks and connections.
    Thanks,
    Matt M.

  • Running Class file

    Hello,
    I am a beginner.
    I got a problem which is every time I run a class file after compiling *.java. I have to type the whole path
    java -classpath C: (foldername) (filename)
    to run the program.
    It is suppose to be no problem once I can run the command "javac" successfully. Now everytime I have to type
    javac (filename)
    Also the setting still got something wrong which it cannot generate the path to /Lib/tools.jar as well
    Could anyone help me on this?
    Thank you very much
    My operating system is Window 98 SE
    Here is my autoexec.bat setting:
    SET PATH=c:\windows;c:\windows\COMMAND;C:\PROGRA~1\SYMANTEC\PCANYW~1
    @SET CLASSPATH=C:\PROGRA~1\PHOTOD~1\ADOBEC~1
    SET PATH=%PATH%;C:\PROGRA~1\COMMON~1\AUTODE~1
    SET PATH=%PATH%;c:\PROGRA~1\COMMON~1\AUTODE~1
    PATH C:\WINDOWS;C:\WINDOWS\COMMAND
    SET PATH=%PATH%;C:\JAVA\BIN
    set CLASSPATH=.:C:\JAVA\lib\tools.jar
    PATH c:\windows;c:\windows\COMMAND;C:\WINDOWS/DESKTOP
    SET CLASSPATH=C:\WINDOWS\COMMAND;C:\WINDOWS/DESKTOP

    Your batch file overrides the value of CLASSPATH several times. Try putting the paths of everything you require into the last instance of the "SET CLASSPATH" line and then eliminate all other instances of it for purposes of readability.
    By the way, this kind of question should probably not be posted in the "Java Virtual Machine" forum. No offense, but the "New to Java Technology" forum would be more appropriate.

  • How to run class files in a jar independently.

    Hello all
    I have a java file which use an API.jar file which is an API file of some other application of mine.This file form a sought of client for that application.Now i want to run this file from command line which is giving NoClassDefFoundError exception.This exception is because of the dependency over API.jar.I dont want to pack this single file into a jar and then run that jar since it only makes a simple task complicated and makes a simple class look like a big application.Can anybody tell me the solution to it?
    Regards,
    Mansi

    MansiSachar wrote:
    I am working on WindowsXP and the command u just sent is again giving the same exception.The exception is :
    Exception in thread "main" java.lang.NoClassDefFoundError: ûcp
    Caused by: java.lang.ClassNotFoundException: ûcp
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    I think the problem can also be the placement of the dependant jars.do i need to keep them in "bin" folder?I am assuming that in the error message, it says "-cp" not "ûcp" Can you confirm that you entered the command as posted? Because it looks like java.exe sees the -cp as the class to execute instead of the classpath option.
    Try using -classpath instead of -cp. What version of java are you using? (java -version should give you the version).
    If the jars are in the current directory, the placement of the jar files is correct.

  • WebLogic looking for class file using the wrong case

    During my ant build, I precompile my JSPs using weblogic.jspc. All of the jars and wars are packaged into an ear and deployed to WebLogic 8.1 on Linux. When I access one of our normal screens, everything is good. Things go wrong when I try to access one of our help screens. We have a base help file that includes another file based on the screen code passed to it. The screen code is used in combination with a HashMap to look up the correct JSP to include. This part goes fine. But when the JSP is included, I get the following error. The best I can figure is that the class file is in mixed case (i.e., SampleHelp00.jsp and SampleHelp00.class), but Weblogic is looking for samplehelp00.class.
    I'm not even where I should begin looking to solve this. Anyone have any ideas?
    ----- BEGIN STACKTRACE -----
    javax.servlet.jsp.JspException:
    [HTTP:101249][ServletContext(id=70634941,name=grp,context-path=/grp)]:
    Servlet class jsp_servlet._help.__samplehelp00 for servlet
    /help/SampleHelp00.jsp could not be loaded because the requested class was not found in the classpath
    /usr/share/weblogic/weblogic81/config/wftesttest/webSysServer02/.wlnotdelete/extract/webSysServer02_wf-web-sys.wftesttest_grp/wf-web-sys.wftesttest.war:
    /weblogic81sp5/weblogic81sp5/config/wftesttest/webSysServer02/.wlnotdelete/extract/webSysServer02_wf-web-sys.wftesttest_grp/jarfiles/WEB-INF/lib/Struts_Validator-20010702.jar:
    /weblogic81sp5/weblogic81sp5/config/wftesttest/webSysServer02/.wlnotdelete/extract/webSysServer02_wf-web-sys.wftesttest_grp/jarfiles/WEB-INF/lib/struts.jar:
    /weblogic81sp5/weblogic81sp5/config/wftesttest/webSysServer02/.wlnotdelete/extract/webSysServer02_wf-web-sys.wftesttest_grp/jarfiles/WEB-INF/lib/taglibs-session.jar:
    /weblogic81sp5/weblogic81sp5/config/wftesttest/webSysServer02/.wlnotdelete/extract/webSysServer02_wf-web-sys.wftesttest_grp/jarfiles/WEB-INF/lib/wf.wftesttest.jar:
    /weblogic81sp5/weblogic81sp5/config/wftesttest/webSysServer02/.wlnotdelete/extract/webSysServer02_wf-web-sys.wftesttest_grp/jarfiles/_wl_cls_gen.jar:
    /weblogic81sp5/weblogic81sp5/config/wftesttest/webSysServer02/.wlnotdelete/extract/webSysServer02_wf-web-sys.wftesttest_grp.
    java.lang.ClassNotFoundException:
    jsp_servlet._help.__samplehelp00.
    at org.apache.struts.taglib.template.InsertTag.doEndTag()I(InsertTag.java:149)
    at jsp_servlet.__su_hl0._jspService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )V(__su_hl0.java:289)
    at weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse; )V(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl; )V(ServletStubImpl.java:465)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse; )V(ServletStubImpl.java:348)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse; )V(RequestDispatcherImpl.java:328)
    at org.apache.struts.action.ActionServlet.processForward(Lorg/apache/struts/action/ActionMapping;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )Z(ActionServlet.java:1847)
    at org.apache.struts.action.ActionServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )V(ActionServlet.java:1568)
    at org.apache.struts.action.ActionServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )V(ActionServlet.java:491)
    at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )V(HttpServlet.java:740)
    at com.clear2pay.ppp.util.ui.struts.ActionServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )V(ActionServlet.java:138)
    at javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse; )V(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl; )V(ServletStubImpl.java:465)
    at weblogic.servlet.internal.TailFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain; )V(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse; )V(FilterChainImpl.java:27)
    at com.clear2pay.ppp.util.ui.SetCharacterEncodingFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain; )V(SetCharacterEncodingFilter.java:150)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse; )V(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:6987)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction; )Ljava/lang/Object;(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction; )Ljava/lang/Object;(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl; )V(WebAppServletContext.java:3892)
    at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread; )V(ServletRequestImpl.java:2766)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest; )V(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
    at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread; )V(Unknown Source)
    ----- END STACKTRACE -----
    Message was edited by:
    cabuki

    Ignore the part about precompiled JSPs being ignored on my development server. Turns out I had a stale cache. I cleared that out and now it recognizes the files.
    The problem with that, is now I'm getting an Error 500 when I try to access the page.
    ----- BEGIN STACKTRACE -----
    javax.servlet.jsp.JspException
         at org.apache.struts.taglib.template.InsertTag.doEndTag()I(InsertTag.java:149)
         at jsp_servlet.__su_h0._jspService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse; )V(__su_h0.java:316)
         at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse; )V(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object; (ServletStubImpl.java:996)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl; )V(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse; )V(ServletStubImpl.java:315)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse; )V(RequestDispatcherImpl.java:318 )
         at org.apache.struts.action.ActionServlet.processForward(Lorg.apache.struts.action.ActionMapping;Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse; )Z(ActionServlet.java:1847)
         at org.apache.struts.action.ActionServlet.process(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse; )V(ActionServlet.java:1568 )
         at org.apache.struts.action.ActionServlet.doGet(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse; )V(ActionServlet.java:491)
         at javax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse; )V(HttpServlet.java:740)
         at com.clear2pay.ppp.util.ui.struts.ActionServlet.service(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse; )V(ActionServlet.java:138 )
         at javax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse; )V(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:996)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl; )V(ServletStubImpl.java:419)
         at weblogic.servlet.internal.TailFilter.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain; )V(TailFilter.java:28 )
         at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse; )V(FilterChainImpl.java:27)
         at com.clear2pay.ppp.util.ui.SetCharacterEncodingFilter.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain; )V(SetCharacterEncodingFilter.java:150)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse; )V(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava.lang.Object;(WebAppServletContext.java:6458 )
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedAction; )Ljava.lang.Object;(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction; )Ljava.lang.Object;(SecurityManager.java:118 )
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic.servlet.internal.ServletRequestImpl;Lweblogic.servlet.internal.ServletResponseImpl; )V(WebAppServletContext.java:3661)
         at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.ExecuteThread; )V(ServletRequestImpl.java:2630)
         at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest; )V(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178 )
         at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread; )V(Unknown Source)
    ----- END STACKTRACE -----
    The page in question is just a simple JSP using Struts (v 1.0.2) to call in a template.
    ----- BEGIN JSP -----
    <%@ page language="java" contentType="text/html; charset=UTF-8" %>
    <%@ taglib uri="/WEB-INF/lib/struts.tld" prefix="struts" %>
    <%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri='/WEB-INF/lib/struts-template.tld' prefix='template' %>
    <template:insert template='/t/system.jsp'>
    <template:put name='title'><bean:message key="tit_su_h0"/></template:put>
    <template:put name='sidenav' content='/t/su_snv.jsp'/>
    <template:put name='content' content='/c/su_h0_c.jsp'/>
    <template:put name='footer' content='/t/su_ftr.jsp' />
    </template:insert>
    ----- END JSP -----
    I passed the -keepGenerated flag to the precompile task in my Ant build so I could look at the line it's choking on, but it's not very helpful. I'm stuck. I can set up the build so it doesn't precompile the JSPs, but then the QA team wouldn't like me very much.

  • Running .CLASS file in Java JDK1.3.1_19

    Hello
    i am an old java programmer. but stopped for a while... so i guess im a bit rusy at it...
    anyway...
    i installed jdk1.3.1_19 on my pc and did everything as they asked for in the installation but i get an error wen i run the .CLASS file
    the error i get is:
    "exception in thread 'main' java.lang.NoClassDefFoundError: C:\jexamples\Welcome1"
    i read a documentation abt some CLASSPATH... which im kinda confused abt... how do i set that? and wat do i set it as?...
    Thanx for the help in advance!

    i am an old java programmer. but stopped for a
    while... so i guess im a bit rusy at it...
    anyway...
    i installed jdk1.3.1_19 on my pc Why did you install an old version instead of the latest version?
    and did everything
    as they asked for in the installation but i get an
    error wen i run the .CLASS file
    the error i get is:
    "exception in thread 'main'
    java.lang.NoClassDefFoundError:
    C:\jexamples\Welcome1"
    i read a documentation abt some CLASSPATH... which im
    kinda confused abt... how do i set that? and wat do i
    set it as?...Do not set or use the CLASSPATH environment variable. Instead use the -classpath option when compiling or running your programs. Otherwise, you'll never figure out what's going on.
    When asking about compiling problems, you need to post:
    1) The path to all the files used in your program
    2) The prompt where you entered the commmand
    3) The actual command you entered

  • Running  .class file from autoexec.bat (in Windows Xp environment)

    How to run a .class file from autoexec.bat file. I have WinXP installed on my PC. I tried the solution given by Forum memebers but they didn't work.
    after setting the classpath
    i wrote
    java -cp simple in autoexec.bat , but results were not satisfactory.

    What does "not satisfactory" mean? If the commans works from any .bat file, it'll work from autoexec.bat, too.
    May I ask what you're trying to accomplish? I'm not sure whether XP dtill uses autoexec.bat for console initialization after all.

  • HELP: ClassLoader cannot find .class file

    Hi,everybody:
    I'm working on a project of auto-testing, and need the java.lang.ClassLoader to load the to-be-tested java file.
    It can be simply described as the following code:
    public class tt {
    public static void main(String[] args) throws Exception{
    Class testClass;
    String testClassName="TestExample";
    String path = System.getProperty("java.io.tmpdir");
    URL[] urls = {new URL("file://" + path )};
    ClassLoader testCaseLoader = new URLClassLoader(urls);
    testClass = testCaseLoader.loadClass(testClassName);
    The process is that, put the to-be-tested file to a certain directory, compile it, and finally load it. For example, in the above code, i want to load the class "TestExample".
    But it always report the exception: java.lang.ClassNotFoundException: TestExample .
    Note, cannot put the to-be-loaded .class file in the same directory with the loading-code, or the loading-code will defaultly find the to-be-loaded .class file , and there would be no exception.
    I use jdk6.
    I really cannot figure out the problem. Could anyone help me? Thanks a lot.

    MyCoy wrote:
    To malcolmmc:
    thanks. but what is FQN ?
    Fully Qualified Name
    That is, the class name including the package name. Eg java.lang.Object

  • Java not running .class files

    I rebooted my computer, and now whenever I type
    java <filename> it responds with:
    C:\Development\Java\Projects\Scratch>java T1
    Exception in thread "main" java.lang.NoClassDefFoundError: T1
    However, it compiles fine:
    class foo {
    class T1 {
        public static void main (String [] args) {
            foo [] fooArray = new foo[5];
            if (fooArray[1] instanceof Object)
              System.out.println("fooArray[1] is an object");
            if (fooArray[1] instanceof foo)
              System.out.println("fooArray[1] is a foo");
    }What am I missing to get it to run with java T1?
    (every other class file that used to work behaves the same way)

    Yes, it is the classpath. Strangely . is in my classpath in the environment settings in the control panel. I guess I can survive adding -cp . but it is kind of a pain in the a__ for no reason I can discern

Maybe you are looking for

  • I am independent artist, want to upload my album for sale on iTunes. How to do it?

    I am an independent artist, would like to upload my album on iTunes for sale. How to do it?

  • Restore "Notes" column in iCal ?

    I display iCal as weekly window.  Previously on the right there was an open column where I could list my "items-to-do".  This is now gone and I can find no way to restore it!  Is there a way to get back what was there through Lion? (Sometimes Apple s

  • Vista and iTunes 7.7 Freezing

    I'm getting several lockups either at launch or close of iTunes. Like right now, I started iTunes up, and it's sitting on my desktop frozen. Not even Task Manager will close it. And when it does work, it won't stop working! Attempting to close iTunes

  • Creation of Purchase Requisition with Sale order

    Hi, I have a scenario where I need to create a Purchase requisiton for the requirement from the sale order (like the Third party sale order). I have done the required configurations to create the Purchase requisition. My Sale order has three line ite

  • Connect a iPOD to two computers

    Can i hook up my mini to two computers (well a PC and a Laptop) and if yes how! if no what are my options? Thanks