Am not able to run the java program - pls help

1. I installed java in the below path
     c:\program files\java\jdk1.5.0
     c:\program files\java\jre1.5.0
I set the path in
     User variable i. variable name: path
          ii. variable value: c:\program files\java\jdk1.5.0\bin
when I compile it in command prompt-applying javac ? it performed successfully-shows
options like ?g create all debug info, -g : new Generate no debug info etc.,
But am not able to run the file. It shows error msg.
2. I specified the same name for file name & class name.
3. Java <class name>
     Exception in thread ?main?java.lang.NoclassDeffoundError: <class name>
4. Java ?cp <class name>
     Unrecognized option: -cp.<classname>
     Could not create the Java Virtual Machine
5. Java ?classpath . <classname>
     Exception in thread ?main?.java.lang.unsupported classversionError: <classname>
     <unsupported major.minor version 49.0
          at java.lang.classloader.defineclass0<native method>
          at java.lang.classloader.defineclass<unknown source>
               --and many listed below?
6. Java ?classpath c:\program files\java\jdk1.5.0\bin <class name>
     Exception in thread ?main?java.lang.NoclassDeffoundError: <class name>
7. I re-installed the java, but still the problem continuing.
pls help... its very urgent

Is the java class you compiled/calling in the default package? If it is not, you will have to call it by the fully qualified name.
e.g.
package com.mycompany.myproject;
public class MyClass {
    public static void main(String[] args) { }
}This would be called as "Java com.mycompany.myproject.MyClass" and must contain a main method with signature as above.
You would have to call this from folder where the compiled classes are located. If using package, you would call from directory at level of top most package so com folder in this example as Java will look at each package name in qualified name and try to traverse directories with those same names to get to .class file matching class name specified. To avoid this, your newly compiled .class files must also be in your classpath.
Hopefully that helps.
--Kevin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • I am not able to run the java Program

    Hi All,
    I am not able to run a java program... I am able to complie the program sucessfully when i am trying to run it i am getting a error:
    Exception  in thread "main" java.lang.NoClassFoundError : filename
    i have complie and run my programs frequently but now i am not able run my prevoius examples also ...
    Can u any body help me out...... I have also update the latest version of JRE but still my problem is not sloved.
    Thanks & Regards,
    Ravi

    Make sure you take package structure into account.
    If you have say
    package testing.things;
    public class Test
        public static void main(String[] args)
            System.out.println("World Hello");
    }in file Test.java, you compile it with (assuming your current working directory is at the folder in which the source file is located).
    javac -d . Test.javaand run it with
    java testing.things.TestThe -d . option creates the output at the current directory (with a folder structure matching your package structure).
    #

  • Not able to run the Java Program from jre for the ARM processor

    Hi ,
    I am try to run the jre1.4.2 for the arm core (linux 2.6kernel) which i downloaded from the sun site.
    I am created the class file from the J2SE1.4 development kit. I created the simple HelloWorld Program and complied with J2Se then i copied that class file into my IMX board which has ARM core.
    When i run the commnd java HelloWorld i am getting this error
    dl failure on line 765Error: failed /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjve
    Please give me some suggestion to solve this porblem
    Thanks in Advance
    Narendra

    I JRE i have download from the sun site . But when i am trying to run the simple helloWorld program in that it is giving the below error.
    error:
    dl failure on line 765Error: failed /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjvm.so because /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjvm.so: symbol __divdf3, version GCC_3.0 not defined in file libgcc_s.so.1 with link time reference.
    Can anybody help me in this how to solve this problem . I also searched in the forum but did not get any answer on that problem
    Thanks in advance.
    Narendra

  • Not able to run a java program on Sun Solaris

    Hi All,
    I am getting following error while running a java program. Can you help.
    Thanks,
    --Srini
    Error:
    Exception in thread "main" java.lang.NoClassDefFound

    Hi Sergi,
    Thanks for the info. I couldn't able to login because of my internet connection.
    Thanks,
    --Srini                                                                                                                                                                                                                           

  • Not Able to Run A java Program!!!!!!!!!!

    Hi Gurus
    I have Change my Previos Version of Jdk Now I am getting This Error.
    Exception in thread "main" java.lang.UnsupportedClassVersionError: test (Unsuppo
    rted major.minor version 49.0)
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(Unknown Source)
            at java.security.SecureClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.access$100(Unknown Source)
            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)

    Hi Michael
    I did the same thing not able to get it.I am using java -version its give me
    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)
    CLASSPATH=.;C\j2sdk1.4.2_10\lib\rt.jar;C:\apache-ant-1.6.5\lib;C:\apache-ant-1.6.5\lib\ant.jar;C:\jboss-4.0.2\client\jbossall-client.jar;C:\strutsTutorials\jakarta-struts-1.2.4\lib\struts.jar;C:\log4j\logging-log4j-1.2.13\dist\lib\log4j-1.2.13.jar;C:\log4j\logging-log4j-1.2.13\dist\classes;C:\jakarta-tomcat-5.0.28\webapps\validator\WEB-INF\lib\struts.jar;C:\XMLSerilization\xstream-1.1.3.jar
    Path=C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Rational\ClearCase\bin;C:\Program Files\Rational\common;C:\Program Files\lotus\notes\;C:\apache-ant-1.6.5\bin;C:\j2sdk1.4.2_10\bin;

  • Not able to run the client program

    I have written a simple example to print a string using EJB on weblogic 6.0
    I have written a simple RMI client program .
    when i run that program it is throwing an remote exception saying that connection refused to host..
    pls help me
    redgs
    aaag555

    Have you set the jndi.properties right?
    You'll need to specify username and password correctly....

  • Not able to run the Jdeveloper Pages in Local Machine

    Dear All,
    I am developing Custom OAF Pages in R12. while am not able to run the page in Local Machine Currently i am using Remote VPN. same page i import into server am able to run in Application.
    The error says:
    1, Increae the time limit bye setting the JRAD.RUNREG.TIMEOUT Parameter in ide.parameters file loacted in System directory.
    I found the file . am not able to find the JRAD.RUNREG.TIMEOUT Parameter option
    2, Check the Host Name in the Preferances, Under Embeded OC4J.
    I Verified same and using the Default Local IP Address.
    I am using Jdeveloper Version : p8431482_R12_GENERIC.zip
    Please help me. I approciate before
    Thanks
    Venkat Reddy Pulichintha
    00971502644919
    [email protected]

    Dear Gaurav,
    Thanks for you quick replay
    For this Patch number (p8431482_R12_GENERIC.zip), there is no (JAVA Options: remove this statement: -DFND_JDBC_STMT_CACHE_SIZE=200 -DCACHENODBINIT=true)
    Please guide me furthe steps. any other settings requird.
    Thanks
    Venkat Reddy Pulichintha
    00971502644919
    [email protected]

  • Is it possible to run the java program without main?

    Hi,
    Is it possible to run the java program without main?
    if anybody know please tell me, how it is possible.
    Regards,
    Ramya

    Hi,
    Is it possible to run the java program without main?
    if anybody know please tell me, how it is possible.
    Regards,
    RamyaWhy do you ask? It sounds like an odd question. Your program can be an applet and it doesn't need a main method in that case.
    Kaj

  • Just installed Lion and iCloud. Now I'm not able to open the Mail program. What's the problem? Thanks. Andrew

    Just installed Lion and iCloud. Now I'm not able to open the Mail program. What's the problem? Thanks.
    Andrew

    Dear Ralph, thank you for your lightspeed answer!
    When I had installed the app, there was been written: "open", and when I pushed this, NO reaction of the iPad! And crazy too: I am NOT able to find the app itself at any screen of the iPad!!! I can see it only in the list "bought" items. With other words: The app is neither to be seen nor I am able to open it in the "list".
    Thank you in advance for your advice
    Best greetings from Austria (Wien, Vienna)
    Wiener Schnitzel

  • Not able to view the content in Microsoft help viewer (MS VS 2012)

    Hello Team,
    I'm Rahul from Daimler-Chrysler, Bangalore location. I’m the IT Engineer for Daimler-Chrysler.
    We tried many settings in IE but still not able to resolved. So i need more expert help. 
    My customer having one issue- 
    # User is not able to view the content in Microsoft help viewer (MS VS 2012), below is the error: Its opening in HTML Format.
    So please help me. Contact no- +91-9972004298. and personal id:- [email protected]/[email protected]
    I call you to Microsoft customer care they advice me to ASK Question. Please help me, I'm waiting for your reply.
    Thanks,
    Rahul B. Patil.
    +919972004298.

    Hi Sri,
    it looks that your HANA instance has been created before we enabled the web-based development workbench. Some privileges are missing, we can't migration those existing instances.
    Nevertheless you can ignore the error above. You can see all the content inside your instance "smstest1".
    If you want to get rid of the cosmetic issue. You might delete this instance and create a new one.
    Best regards
    Xu

  • Not able to execute one Java program from another one via. exec()

    Hi,
    I am new to this forum, so I might be asking a very trivial quetion.
    My program Ap1 is :
    class Ap1
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    p=rt.exec("javac,Pr.java");
    Runtime.getRuntime().exec("javac,Pr.java");
    When I run the above program, I get below error at the line 7(bold one):
    D:\batchwe>javac Ap1.java
    D:\batchwe>java Ap1
    Exception in thread "main" java.io.IOException: CreateProcess: javac,Pr.java err
    or=2
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at java.lang.Runtime.exec(Runtime.java:429)
    at java.lang.Runtime.exec(Runtime.java:326)
    at Ap1.main(Ap1.java:7)
    Path is set as below(which seems correct):
    D:\batchwe>path
    PATH=C:\Program Files\Java\jdk1.5.0_05\bin
    I am just wondering how to call one Java program from another one?!
    Please help.
    thanks
    Rashmi

    Hi diptaPB,
    Thanks for your suggestion.
    Here is how I tried it again, but not getting the desired output:
    Class Pr looks like below -->
    class Pr
    public static void main(String a[])
    System.out.println("hi from process");
    When I run 'Pr' from command prompt, i get the desired output:
    D:\batchwe>java Pr
    hi from process
    However, when I call 'Pr' from another program Ap2.java, it seems that it does not call 'Pr':
    class Ap2
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    String[] cmd=new String[2];
    cmd[0]="javac";
    cmd[1]="Pr.java";
    p=rt.exec("cmd");
    D:\batchwe>javac Ap2.java
    D:\batchwe>java Ap2
    ************* no output appears here***********************
    Looking forward for your help.
    regards
    Rashmi

  • NoClassFoundError exception while running the java program

    Hi,
    I am getting the following exception while running a java program CSTToGMTToSQL.java
    Exception in thread "main" java.lang.NoClassDefFoundError: CSTToGMTToSQL
    However, the class file is getting created for this program in the same directory where the program is residing.
    Any idea on this ?
    Regards
    Ramesh

    I know that in the past there was an issue with running a particular version of the SDK on a particular version of windows. The resulant error was a ClassNotFoundException. I am not sure about the versions involved.

  • Not able to run the example given

    Hi All, I just started with J2ME. Tried to run the sample program given in the sun site. The programs are FirstMIDlet.java and HelloMIDlet.java. I've followed the instructions given @ the location 'http://developers.sun.com/techtopics/mobility/midp/articles/setup/#compile'. This page shows how to make the program run. But I couldnt get the color menu out put, coz there is no run.jad file existing in my comp. I didnt understand from where the file should i get and while explaining abt the HelloMIDlet program till jar creation everything went well after creading jar, jad file is been used to execute the program. I didnt understand from where the jad has come. I tried executing the jar file instead, this is the error am getting 'java.io.UTFDataFormatException: invalid first byte 10100000'. Can some help in this. Do I need to do anymore settings ? I think it requires a descriptor file also as well, but not mentioned how to prepare it and where to keep it and how to include in the jar etc...

    Hello. Have you ever tried to download Sun ONE Studio 4 update 1 Mobile Edition it is small, user-friendly and FREE. It is not perfect, but it will work

  • Not able to run the SSIS package in SQL Server Agent Job in SQL 2012

    Hi,
    I scheduled a job (SQL SERVER AGENT) which will call my SSIS package. This package will execute 5 packages in loop.
    When I execute this job I am getting error as below
    ============================================================
    Started  : 12:30:19 PM 
    Error  : 2014-01-23 12:30:20.37    
    Code  : 0xC00220EC    
    Source  : Execute Package Task     
    Description : Error 0x80070005. Failed to create an instance of empty child package.
        The Distributed Component Object Model (DCOM) configuration or the installation of SQL Server Integration Services,
        may be corrupted on your machine.  End Error 
    Error  : 2014-01-23 12:30:20.37    
    Code  : 0xC00220DE    
    Source  : Execute Package Task     
    Description : Error 0x80070005 while loading package file "D:\SSIS\RetailMobileApp\Staging_Pkg\stg_Category_Master.dtsx". Access is denied.End Error 
    DTExec  : The package execution returned DTSER_FAILURE (1). 
    Started  : 12:30:19 PM 
    Finished : 12:30:20 PM 
    Elapsed  : 1.123 seconds. 
    The package execution failed. 
    The step failed.
    ============================================================
    In the STEPS I have selected as follows:
    Type  : SQL Server Integration Services Package
    Run as: SQL Server Agent Service Account
    Package Source: File System
    What config I need to check here ? This job is not able to access the package stored in the folder.
    Sridhar

    Thanks for your reply. I had created credentials and used this while creating the Proxy account. With the Proxy account I am able to execute the Job Successfully. Concern here is I used my NT account to create this Proxy. Suppose If I left from the
    current project if some one is coming to this project later they need to change the credential with their NT account and run the JOB? Is this right way or we an create any other account in common? If so how?
    Sridhar

  • Running the Java program as service.

    Hi,
    I want to create have java program, which runs continously. This would hit check a table in Database for any new records and if there is anything it would post a message to another service. It would keep track of how many messages were posted and how many were completed at any point of time.I should have the ability to stop this service. When a stop sequence is initiated, it should wait till all the messages are processed and shutdown. I am looking for inputs on how to invoke the java program as service and the second part (stopping the service). I dont want to Java wrapper service or commons daemon api. I am on JDK 1.4.2
    Thanks in Advance.
    Regards,
    Arul.

    Do you want to write a daemon? I dont think you can do it without some explicit OS support..
    Well, lemme know if you find a way

Maybe you are looking for

  • Question about Receiver Determination step in BPM

    Hello all, I have a BPM process similar to Multicat BPM Pattern. I have some questions regarding how the Receiver Determination works: 1. Does it have to have interface determination in the Integration Directory? 2. Does that interface determination

  • Connecting iPod Touch 2G to Verizon LG ENV3 via BlueTooth

    I have an old Verizon LG ENV3 and I want to connect it to my iPod Touch 2G via BlueTooth..... I tried to attempt to connect them but it doesn't want to connect....  is there a different way? Anytime I try to connect it my phone says "Device is not re

  • Embed Acrobat Reader in HTML/ASP-Site

    Hi, I have a problem to embed Acrobat Reader 9 in a HTML-Site. Before I used Acrobat Reader 7.x. And with version 7 it works fine. Now, I installed Acrobat Reader 9 it works so different. Here my sourcecode: "< embed id='PDFOBJ' name='PDFOBJ' src='\\

  • Iphone update corrupted during download

    my iphone 6 has currently been in a locked state for a day now everytime i restore from itunes the download gets corrupted and shows the message (the software for _iphone_ was corrupted) i tried manually installing but get error 14

  • Mount not working with external HDD

    So basically my External HDD is not mounting and i have tried using disk utility..... please help getting me to mount it please without reformating