Unable to Execute Class File

Dear All,
I am Using JDK1.3 in Microsoft Windows 2003 sever.
I had Created a test program as follows, Which is Saved in the BIN directory Named t.Java
class t
public static void main (String arg[])
{     System.out.println ("Test Prorgram ");     }
When I compile the above Code it Compiled Successfully.
But, When I try to execute the class
It reports the ClassNoDefFoundException.
It had Try the following Set Classpath = C:\jdk1.3\bin; command, still I have the same problem.
How can I Execute the Class File.?

Run it like this:
java -classpath . tSome useful resource:
Java's code conventions: [http://java.sun.com/docs/codeconv/]
What is the classpath really: [http://en.wikipedia.org/wiki/Classpath_(Java)]
Also, Java 1.3 is really old. I recommend to download and install Java 1.5 or 1.6.

Similar Messages

  • Unable to execute JAR files

    I am unable to execute jar files and applets. Also, the Java Web Start and the Java Plugin Control Panel will not load. I have unloaded the JRE and installed other versions. To date I have loaded and unloaded the following:
    1.4.1
    1.4.2_01, _02, _04
    1.4.2_04 SDK
    But no change in the outcome.
    The javaw application starts but does not load the jar file.
    The applets and jar files run fine on other computers with any of those JRE/SDK's installed.
    Any suggestions would be helpful.

    Command line
    To create a JAR file >jar cvf filename.jar filename.class(s)
    To view the contents of a JAR file >jar tvf filename.jar
    To extract the contents of a JAR file >jar xf filename.jar
    To extract specific files from a JAR file >jar xf filename.jar archived-file(s)
    To run an application packaged as a JAR file
    >jar xvf filename.jar META-INF/MANIFEST.MF
    The above will place META-INF/MANIFEST.MF file in your working directory. Open this file in text editor. Under Version, type in
    Main-Class: filename
    example;
    Manifest-Version: 1.0
    Main-Class: SelectPurchase
    Created-By: 1.3.0 (Sun Microsystems Inc.)
    save file
    update META-INF/MANIFEST.MF file in jar file with;
    jar umf META-INF/MANIFEST.MF filename.jarto run jar file from command line;
    java -jar filename.jarTo run an application packaged as a JAR file
    (version 1.1) jre -cp app.jar MainClass
    (version 1.2 -- requires Main-Class
    manifest header)
    To invoke an applet packaged as a JAR file <applet code=AppletClassName.class
    archive="JarFileName.jar"
    width=width height=height>
    </applet>
    Does anyone know how to get the application to run by clicking on a Desktop Icon?

  • Tomcat Jasper-Unable to rename class file

    I keep getting the following error, whenever i first get
    concurrent hits on a JSP page under tomcat. Successive
    concurrent hits are then ok but sometimes only.
    Can any one help me out in solving this problem.
    Thanks...
    The error is shown below as follows.
    org.apache.jasper.JasperException: Unable to rename class file C:\jakarta-tomcat-3.2.1\work\localhost_8080%2Fisa\ipp\_0002fipp_0002fdettagcutsectwise_0002ejspdettagcutsectwise_jsp_18.class to C:\jakarta-tomcat-3.2.1\work\localhost_8080%2Fisa\_0002fipp_0002fdettagcutsectwise_0002ejspdettagcutsectwise.class
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:270)
         at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
         at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
         at org.apache.tomcat.core.Handler.service(Handler.java:286)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
         at java.lang.Thread.run(Thread.java:484)

    Hi,
    Most of the time error occurs on Windows plateform.
    The main reason behind this is nesting of the directories.
    Also the long directory names causes this problem.
    Thus try to keep the directory name small and the try to nest the directories to store the jsp's
    I have faced same problem when i used to work on Tomcat. But this problem is never occurd on Resin.
    Well try these options. This may help u...
    Kind regards
    Chetan Chandarana

  • Executing class files

    Pls help I got following error while executing class file.
    Exception in thread main java.lang.NoClassDefFoundError : main
    Edited by: Mubin_Attar on May 19, 2008 6:34 PM

    Mubin_Attar wrote:
    Pls help I got following error while executing class file.
    Exception in thread main java.lang.NoClassDefFoundError : main
    Edited by: Mubin_Attar on May 19, 2008 6:34 PMIt appears that you typed "java main" or something like that, which means you have a file named "main.class". This is telling you that you don't have such a file.

  • Execute *.class file by DoubleClicking

    I use WinXP.and i tryed to let my OS execute *.class file by Doubleclicking. to do so i used Windows Explorer->Tools Menu->Folder Options Menu->File Types Tab and then i registered CLASS file type. on its open action i wrote "C:\JAVA_HOME\jdk15\jre\bin\java.exe" "%1". but when i try to execute *.class file its gives error.
    i guess that windows executes the command "%JAVA_HOME%\bin\java.exe C:\aaa.class" when i double click aaa.class file icon. So the java.exe tryes to execute "class.class" file of "aaa" package. Is there any way to cut ".class" of the command.
    otherwise is there another way to do that?

    This way works in XP:
    Create a batch file "runJ.bat" with these contents:
    @ECHO OFF
    rem This batch program is invoked when a .class file is double-clicked.
    rem This is done by registering the extension .class and associating
    rem this file with its opening. The expression %~n1 removes the path
    rem and the .class suffix, leaving just the filename.
    java %~n1
    pauseAnd create the file association using the following in the open command:
    "<path>\RunJ.bat" "%1"

  • Execute Class file

    Is is possible execute the class file without the intepreter?
    If can , how to do?
    Can I convert the class file to exe file ?

    Is is possible execute the class file without the
    intepreter?No, only if you run on a platform that understands the java bytecodes without an interpreter.
    Can I convert the class file to exe file ?Yes, search for java exe(cutable) in the forum or the web. You need a program to do this conversion, but then your program will only run on windows.

  • Error when trying to execute .class file.

    Hello,
    I downloaded jdk 1.5 from the official java website and have installed it properly. I tried compyling my java program and it gets compilde. But when I try to execute it I keep getting the error "Exception in thread "main" java.lang.NoClassDef Found Error". Please help me .........

    It's because java can't find one (or more) of your .class files. You have to tell it by passing the correct classpath to java.exe.
    Read about the classpath and java launcher here:
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html
    Message was edited by:
    Loko
    Because:
    Something is definitely wrong with the formatting

  • Executing .CLASS file

    Hello,
    I recently had my machine reimaged and I'm trying to configure it to execute Java class files from the command prompt. After manipulating the PATH and CLASSPATH system variables I was able to get it to the point where I can compile .JAVA source code, but I still can't execute the file.
    The source is named NotesExport.java. I can issue the javac NotesExport.java command successfully, but when I issue java NotesExport, it gives the following error:
    Can't find class NotesExport
    I've confirmed that the NotesExport.class file is indeed there so I'm confused as to why it can't be found.
    Does anyone know what's wrong here?

    Yes, the problem is with the import line below:
    import lotus.notes.*;
    public final class NotesExport extends NotesThread{ <rest of code> }I was told that in order for the import command above to work, I need to add the path to the notes.jar file in my classpath (c:\notes\notes.jar). I've done that, but it still doesn't work. I get the following error messages when I compile this code in JCreator:
    --------------------Configuration: JDK version 1.1.8 <Default>--------------------
    C:\SasJava\NotesExport.java:9: Package lotus.notes not found in import.
    import lotus.notes.*;
           ^
    C:\SasJava\NotesExport.java:11: Superclass NotesThread of class NotesExport not found.
    public final class NotesExport extends NotesThread{
                                           ^
    2 errors
    Process completed.I'm assuming that the NotesThread class is bundled into that notes.jar file, but I'm not sure. I'm also not sure what that lotus.notes.* is all about... I figured that package was part of the notes.jar file too. Since it apparently isn't finding the notes.jar file, even though I tell it where it is in my CLASSPATH, nothing is working!

  • Unable to execute a file which is shown to exist by ls

    Like I said, ls reports the file as existing, colors the filename green showing it's an executable, which was confirmed by `ls -l`. Normal file manipulation such as rm, mv, cp, etc all seem to work. Bash can not execute the file, reporting it as non-existant, and sh can't execute it either.
    It might be a permissions issue but I doubt it, the file's permissions are as follows: All can read, only the owner can execute, write, AND read.
    The file along with the others in the directory were extracted from a zip archive by the latest version of unzip (as pulled from the arch repos).
    Last edited by eulallia1 (2009-07-01 13:08:38)

    mcmillan wrote:gconf isn't a library file. It should probably work using the 64bit version of it, so pacman -S gconf
    Oh, thank you. I'm not entirely used to linux yet, even though I've used it for months.
    Well I'm having a different issue now at the moment. lib32-nss is installed but chrome is reporting an error stating that it's elf-class is ELFCLASS64, so the library is 64-bit. Where do I find the 32-bit nss Library (locally, as lib32-nss was installed by pacman)? At first, chrome threw an error because it couldn't find libnss3.so.1d, so I copied libnss3.so as libnss3.so.ld.
    (Edit)
    I fixed that issue.
    Chrome is now throwing an error before execution (before it was because it couldn't handle the 64-bit libraries so I had to copy the 32-bit versions from /opt/lib32/), about libgconf-2.so.4, because it is 64-bit. This may sound like a repeat of the issue before but it truly is not. This time, due to ambiguous naming conventions I can not replace the library it is complaining about because it is in a sense, a necessity. Things could quite easily go wrong if I replaced it with a 32-bit library just to satiate chrome.
    In short, Is there some prefix path variable or something, thus eliminating chrome's constant checks of /usr/lib and instead redirecting them to /opt/lib32?
    Because I believe I've heard of a variable which contains colon separated library directories for applications to check through but I can't remember what it was called, just that it was a part of ldconfig.
    Finally, (hopefully after this question and the prior question, there won't be anymore ),
    is there a way to install a 32-bit version of libdbus-glib? E.g., using make to compile a 32-bit version. (Edit: Compiling the latest dbus-glib doesn't work, as online forums seem to say that a 32-bit version 'libc9' (ubuntu forums) is necessary. Glibc is installed in both 32-bit and 64-bit versions on this system)
    Last edited by eulallia1 (2009-07-01 17:33:59)

  • Windows Trick: Executable Class Files

    This is in "new to java" for a reason.
    I dont want to be flamed for posting something obvious, lol.
    Its just a simple trick to fire up programs by double
    clicking a class file. This is for minor cases that dont warrant an
    executable JAR.
    I was never able to get this working before but i stumbled on this
    tech tip that made it all possible:
    http://blogs.msdn.com/ben/archive/2007/03/09/path-manipulation-in-a-batch-file.aspx
    HOW TO:
    Create a new text file with the following contents:
    @title %~n1
    cd "%~dp1"
    java -cp . %~n1
    Alternately, if you dont want to see the command window at all (like
    with javaw) use this text INSTEAD:
    start "%~n1" /D"%~dp1" javaw -cp . %~n1
    Save this file as "javalauncher.bat" (it has to have a .bat extension).
    Save it into a reliable folder. The java folder is a good place
    for this. On my computer that is: C:\Program Files\Java\jdk1.6.0
    FINALLY:
    (1) Open Windows Explorer (or "My Computer")
    (2) Go to Tools -> Folder Options -> File Types
    (3) Find the CLASS extension (or create it by hitting the "New" button)
    (4) Select it and hit "Advanced"
    (5) Select "open" action and hit "Edit" or create a new action
    Action: open
    Application Used To Perform Action: C:\Program Files\Java\jdk1.6.0\javalauncher.bat "%1"
    Explanation:
    The action variable %1 returns a full path. Passing this to java
    with "java %1" doesnt work so I gave up on this a long time ago.
    Unfortunately the batch file file path manipulation trick doesnt work
    in the action window "java %~f1" so a batch file is necessary.
    Also anyone trying to condense these lines:
    cd "%~dp1" java -cp . %~n1 into this:
    java -cp "%~dp1" %~n1 ... that will NOT work
    if you are in a folder with spaces in the path.
    For some reason java doesnt recognize quoted
    paths that end in a path separator:
    java -cp "C:\a space\" Program <--- fails
    Why not a simple exe? With this method you can pop into the java
    launcher bat file and make little tweaks if you ever have to.
    Plus a SINGLE line of text is better then opening up MSVC++
    creating an entire project, compiling etc etc.
    Why not a JAR? This is just for the simple programs beginners would
    write (an intermediate step between the command line and an IDE!).
    Why else is this a good idea? Beginners learn the basics of BAT files
    and what they can do. This technique is extensible to a Compile and
    Jar Me Up! action.
    Also, you can create actions involving Java programs called from a
    bat for more complicated things. For example: right click on a .JAVA file
    and it will write the manifest file and jar up every java file in the folder.
    Also, why not. It takes 2 minutes?
    EDIT: quotes missing in the start command fixed

    until recently, I had a .bat file successfully executing one of my class files.
    Something changed, and not I get this error.
    Exception in thread "main" java.lang.NoClassDefFoundError: BatchStandaloneso my basic question is, what all would I need to have on the CLASSPATH or PATH again to have this work? I am thinking that's what got disrupted.
    Because now it doesn't work, and I seem to believe I inadvertently changed that. I may have added a jar file to my commons/lib dir in Tomcat, but that shouldn't have altered it so drastically.
    Thanks.

  • Executing class files from a Java App dynamically

    Hi!, Is there any way i can execute java .class files from my Java Application dynamically. I know that java uses Dynamic method Invocation. Is that true of class files generated using some other language compiled for the JVM.
    In my case i would like to make a Web browser that interprets HTML and also java applets embeded in them. I would like to use the JRE of the platform execute the applets for me rather than writing the code for my Browser to interpret the class files.
    Thanks in Advance.

    You just need a custom class loader to bring these applets into your JVM.
    http://developer.java.sun.com/developer/onlineTraining/Security/Fundamentals/magercises/URLClassLoader/index.html
    Then you can use the methods of java.lang.Class to create an instance of such a class. As soon as you have it, you can just treat it as a regular Applet and invoke init(), stop() etc. appropriately.
    If you want to execute anything else than conventional Applets, you might consider reflection to find out about methods implemented:
    http://java.sun.com/docs/books/tutorial/reflect/index.html

  • I am unable to execute swf file present in server on local machine.

    Hi all,
        I am a newbie to Flash and ActionScript 3.0 platform. I don't know whether this is the correct place to post this kind of queries/problems/issues here. Till now, I had posted only basic flash issues here in this forum. I feel this is the most powerful issue which created head-ache to me till now. I spent nearly 4 hours working with this issue. But, I don't find any solution even in google.
        I have created a swf file, which when gets executed, gets data from backend database and displays as items in Combo-box. In swf file, if we select an item from Combo-box, collects data from database and gets back to flash and displays them as items in Combo-box. Each item has a specific image(.jpg file)associated,which gets displayed on stage of flash file(.swf file) upon selected from combo-box.
        I am calling/invoking the flash file, When I click on a Button/select a tab created within my Java application.But,when the button gets clicked/tab gets selected, Combo-box is visible in flash file, but with no elements when we try to click upon it and the following error is getting displayed in a dialog-box:
    Title of the error is: An action-script error has occured.
    The error messsage is:
    Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://localhost:8888/com.mymdworld.Application/DynaAccess.swf cannot load data from http://www.example.com:8080/servlet/getviews.
              at DynaAccess_fla::MainTimeline/DynaAccess_fla::frame1()
    Also, the dialog-box contains two buttons namely, "Dismiss All" & "Continue" buttons.
    Please, I request anyone to help me regarding this.
    Actually, What is going on internaly? & Why for is this error?
    Please, spend 2 minutes of your valuable time in filling the reply to this thread.
    I will be waiting for your replies...
    Thanks in advance...
    Srihari.Ch

    http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html
    Check the docs and google "crossdomain policy"

  • Unable to execute sh file from java file on the solaris

    hi all
    i have written a java program through which i want to shutdown the weblogic server on the solaris.
    I have written following code
    static Runtime objruntime = null;
    objruntime = Runtime.getRuntime();
    Process objprocess=null;
    String url = "/home/xxx/xxx/xxxx/xxxxx/stopWebLogic.sh";
    try {
                   objprocess = objruntime.exec(url);
                   objprocess.destroy();
                   System.out.println("Server shutdown OK..");
              } catch (Exception e) {
         System.out.println("Error executing Cedera Server shutdown." + e);
    I am able to execute the above code on the linux 7.1 means server get shutdown forcefully.
    But when i am trying to execute above code on solaris, server is not getting shutdown.
    Can anybody please help to solve this problem.
    Thanks in advance
    regards
    andy

    we didn't got what you are trying to say..
    what i want to achieve is...
    we are having one condition check in Startup class if that condition becomes false we have to stop the weblogic from starting up.
    if we execute same command posted previously from shell directly its' working fine.
    we are using "csh" shell. we have also tried to execute the command as follows - " csh /home/xxxx/xxx/xxx/xxxxx/stopWebLogic.sh"
    but no achievement.
    it seems that "objruntime.exec(url);" is not able to invoke the shell script "stopWebLogic.sh". We have also checked the execute permission for the same.
    Neither we are getting any error nor any message.
    can u please give us some guide lines on how to achieve this.

  • Unable to execute xsql files

    Hello,
    I am not able to display the XML document from helloworld.xsql. The web server displays the document has is in IE 5.0. I am using the JRun for servlets along with personal web server. I have configured all the calsspath. The only thing I am unsure is configuration of oracle.xml.xsql.XSQLServlet.
    Where should it be configured in Jrun?
    Any help would be appreciated.
    Thanks,
    RP
    null

    Hi Ozawa,
    Thanks for yr reply. I have set the mapping & the aliases as u have mentioned. Also I have the classpath in JRUN set to all the files given below. But I cannot still display the XML document. I have also given below the modified XSQLConfig.xml file. As u can tell I am using MS-access DB.
    I tested by putting the file (helloworld.xsql) both within the root directory of my web server & servlet directory, without any results.
    Can anybody out there or Ozawa please help me out with this.
    Thanks in advance,
    RP
    C:\OracleXSQL/xsql/lib;
    C:\OracleXSQL/xsql/lib/oraclexsql.jar
    C:\OracleXSQL/xsql/lib/classes111.zip;
    C:\OracleXSQL/xsql/lib/xmlparserv2.jar;
    C:\OracleXSQL/xsql/lib/oraclexmlsql.jar;
    C:\OracleXSQL/xsql/lib/XSQLConfig.xml;
    XSQLConfig.xml file:
    <?xml version="1.0" ?>
    <XSQLConfig>
    <connectiondefs dumpallowed="no">
    <connection name="demo">
    <dburl>jdbc:odbc:@prog61.planet.net:Student</dburl>
    <driver>sun.jdbc.odbc.JdbcOdbcDriver</driver>
    </connection>
    </connectiondefs>
    <actiondefs>
    <action>
    <elementname>param</elementname>
    <handlerclass>oracle.xml.xsql.actions.ExampleGetParameterHandler</handlerclass>
    </action>
    <action>
    <elementname>current-date</elementname>
    <handlerclass>oracle.xml.xsql.actions.ExampleCurrentDBDateHandler</handlerclass>
    </action>
    </actiondefs>
    </XSQLConfig>
    null

  • Unable to produce .class file

    Hi All!
    Please read the code as follows in my last question.
    class BicycleDemo {
    public static void main(String [] args) {
    // Create two different Bicycle objects
    Bicycle bike1 = new Bicycle ();
    Bicycle bike2 = new Bicycle ();
    // Invoke methods on these objects
    bike1.changeCadence (50);
    bike1.speedUp (10);
    bike1.changeGear (2);
    bike1.printS

    stop making new threads!

Maybe you are looking for

  • How to change the size of the text inside a label?

    Hello, I would like to change the size of the text inside a label. Is there any way to do it Web DynPro?

  • Why having problem after updating to IOS 7?

         My unit is Iphone 5 and bought it 3rd week of  August with serial no. F1*******TWF. Recently, I updated to IOS 7. After updating I am having problem downloading applications like Candy Crush, Chikka Messenger and etc. Whenever I download apps it

  • Java IOException:exceeded the configured maximum no.of connections

    Folks, I need some urgent help please, I have developed an application that sends messages in XML Format to the Server and the server sends a response back. A new request is sent by the client as soon as it receives a response from the client So if I

  • IPhone 4 16GB black.

    It's locked on Spain, I'm from Romania. Here is my IMEI : 012961006097330. The guarantee and contract expired some time ago. Can I have it now neverlocked?

  • Memory fragmentation.

    Hello Everybody, Can anybody pl. explain what is the mean of shared pool memory fragmentation, in reference to Shared Pool Tuning. Thanks