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

Similar Messages

  • Is it possible to run a java program without using the command prompt?

    Hi,
    I was wondering whether it is possible to run a Java program (not an applet) without using a command line in the command prompt?
    Basically I want to run a program that will be continually running in the background and hence I don't want to have a command prompt screen loaded up as well - I just want the program to be running in the task bar.
    I know how to run the program in the task bar - but I still need to launch the program from the command prompt - is there anyway I can get a program running without having to start it from the command prompt?
    Cheers

    Or create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).

  • 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).
    #

  • Running a Java program without the JRE...

    Hi there,
    I was wondering whether it is possible to run my java applications on a system that does not have the JRE installed?
    Is there a way to compile the java bytecode into an executable - let's say for windows.
    Thank you

    See:
    http://www.bearcave.com/software/java/comp_java.html
    Yair.

  • 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.

  • 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

  • To run the java application without jdk package

    i would like to know whether possible to make the java .class file as .exe file to run in window environment without the help of jdk package.....if the answer is yes,,,,,is it going to use the jvm???is it come together with window os or not and start from which windows version?? or do we need to use the jre??? actually i would like to make installation package to install an application in windowsxp....i know how to do that one in vb and i've done that one before using visual studio 6.0.....is there any possible way....but please explain in easy words and way coz i might not understand if too technical...nobody can help me in my college,,,even lecturers.....thanks a lot

    i would like to know whether possible to make the java .class file as >>.exe file to run in window environment without the help of jdk >>package.....Yes it is possible, there are many tools like one mentioned above to convert your java .class program to .exe and you dont need jdk for that, though you will need JVM
    if the answer is yes,,,,,is it going to use the jvm???Yes it needs a JVM
    is it come together with window os or not and start from which windows >>version?? You need some tool like PJ2Exe or one mentioned above to convert it to .exe, it wont be available with OS.
    or do we need to use the jre???Yes you will need to install JRE for the JVM
    actually i would like to make installation package to install an >>application in windowsxp....i know how to do that one in vb and i've >>done that one before using visual studio 6.0.....is there any possible >>way....Yes it is possible,
    Make a .exe of your application and using VB make a setup file which takes care of installing JRE as well as your application.
    Regards
    Rohan

  • How to run a java program without Java Compiler

    I have a small project and I want share it with my friends but my friend'pc have not
    Java compiler.
    for example, I writen a application like YM, then 2cp can sent,receive messege. My cumputer run as Server, and my frien PC run as client.
    How can my friend run it? or how to create an icon in dektop tu run a java program..??..
    (sorry about my English but U still understand what i mean (:-:)) )

    To run a program you don't need a Java compiler. Just the Java Runtime Engine. That can be downloaded from the Sun website and comes with an installer.
    You could then turn your application into an executable jar file and start it somehow like jar myYM.
    There is also software that packs a Java program into an executable file. I've never used that but one that comes to my mind is JexePack. It's for free if you can live with a copyright message popping up every time you start the program.
    http://www.duckware.com/jexepack/index.html

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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

  • How to run a Java program without the command line.

    Is there anyway to create a Java program that runs like most programs do in Windows ,by double clicking on their icons?
    Thanks,
    Vance

    http://www.ej-technologies.com/products/exe4j/overview.html
    Looks kinda cool. Most java-2-exe programs are usually way too expensive and wont work with GUIs and require other dlls/libraries...

  • How to run the java program from another directory?

    Hi
    Assumption:
    data.java is in a package suncertify.db and place in a directory c:/code/suncertify/db/ directory
    data.class file: is in c:/code/suncertify/db/ directory
    current directory: c:/
    How can execute the data.class directly in c:/ directory without changing directory to c:/code/ ?
    Thanks in advance,
    Adrian

    Yes. You can use the -classpath and -sourcepath options to specify where to look for source files, and the -d option to specify where to generate the class files. Look up the usage of those options in the javac documentation:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html

  • Is it possible to run a java application/program forever?

    Hi,
    Is it possible to run a java program forever?
    if so please reply how it is possible
    thanks in advanced.

    There was a computer with many processes.
    Some processes came and went: they exited either voluntarily by calling exit(2),
    simply returned from their main method, or were terminated by a signal
    like SEGV, TERM, and the dreaded uncatchable KILL.
    Other processes strove to eternal running: they detatched themselves from their
    controlling terminals, ignored the HUP signal or even interpreted
    it as an occasion to reread their configuration instead of
    taking it as a notification on the line's "hanging up"
    or more generally the controlling pseudo or virtual terminal's being closed.
    Resources were acquired and released, processes came and went, some stayed though.
    Long-running processes were experienced to writing ever growing "access" and "error" logs.
    Rumors went around about "garbage collection" and "memory leakage".
    The processes started to think: "What if not all resources get released?
    What if the available memory shows an overall shrinking trend
    and in the long term it will be totally exhausted?
    What if the disk space get freed in a lesser pace as it gets consumed?
    How shall we survive in a Universe where there is no space is left
    even for sysem logs?"
    The processes made the observation that they were identifed by their process id's
    (pid of the integral type pid_t), and the only way they to create a process
    was the fork(2) system call, which returned 0 to the child,
    the positive pid of the child to the parent, and a negative value on error.
    Thus the pid could only be postive numbers.
    The processes observed the one "init" with pid=1, the smallest thinkable pid.
    They asked: "Will it run forever? If not, what will become of us?
    If a process exits without wait(2)-ing for its children,
    who will inherit it if "init" no longer exists?"
    They came to the conclusion that no process could have existed before this one,
    so their universe began once, was not infinite in the past.
    They called this event (which lead to the existance of the process "init"
    and actually their whole universe) "The Big Bang" or "The Big Boot".
    "Is it possible that different, parallel universes exist?
    Is it possible that different, parallel universes arise with different laws and system API's?"
    - they asked.
    Will their universe exist for eternity?
    If yes, in what conditions? Will it eventually run out of the resources,
    will it become cool and frozen with no memory, no available disk space,
    with no resources left drifting along with no activity?
    Or will their universe come to an end, to a condition where
    signals (TERM and then KILL) fly to all processes,
    all file system get umounted, all activity stops?
    "Big Crash" or the "Big Shutdown" they called this scenario.

  • Running a java program from an icon

    I want to run my program from an icon on my desktop. I have a .bat file that I've built a shortcut to and it works.MY GUI program does display and run when I click on the icon. The problem is that the DOS window also shows up behind my GUI.
    Is there anyway to prevent the DOS window from showing? Or is there another way to run a Java program without resorting to a DOS command line or running it through FORTE or another IDD?

    Chris's solution worked well, with one small problem. Once my GUI starts, it takes up the whole screen. Normally when I run it, it appears as a small window.
    not a big problem, I can reduce it easily after it starts. But does anyone know a way to make it come up in the reduced size it norally comes up in when I run it from my IDE?

  • How to invoke the .bat(batch file ) from the java program

    i want to run some commands when i run one java program.
    I wrote those dos commands on the batch file and i want to include the bat file in the java program so that i can execute the bat file when i run the java program.
    tell me the way that i can run my bat file inside the java program.

    i tried this :
    a .bat file named test.bat, with this code : copy test.bat test2.bat
    a java class, Test.class, in the same directory
    public class Test {
         public static void main(String[] args) {
              try {           
                   Runtime rt = Runtime.getRuntime();
                   Process proc = rt.exec("cmd /c test.bat");
                   proc.waitFor();
                   int exitVal = proc.exitValue();
                   System.out.println("Process exitValue: " + exitVal);
              catch (Throwable t) {
                   t.printStackTrace();
    }

Maybe you are looking for

  • How can I manually transfer album artwork from my library to my iPod

    I downloaded album artwork to the songs in my library, and now I want to get the artwork onto the songs on my iPod classic. Problem is, I manually manage the songs on my ipod, instead of auto-syncing.... so when I hit the "sync" button in the latest

  • Tree in wd abap

    Hi all, i have a table which has certain data. i also have a tree ui in my wd. the first record in the table is the root and rest are child. how do i populate the tree. plz help me with code snipet if possible. reply soon Thanks & Regards, Ritwik.

  • How to use 45W MagSafe 2 Power Adapter with cable management MagSafe 2 power port macbook air 2013

    How to use 45W MagSafe 2 Power Adapter with cable management MagSafe 2 power port macbook air 2013 there's two plugs do I use both for the safety to work or I just one ? Thanks sorry new macbook air 2013 was given to my daughter fir her 18th bday 2 d

  • Frequency Control Word (PXI-5402): Rounded up or down?

    A further question wrt PXI-5402 standard function generation. The frequency control word is calculated by dividing the desired output frequency by the sample clock frequency (100MHz for a PXI-5402) and multiplying it by 2^N where 'N' is the width of

  • ArrayOutOfBound exception thrown in JAI API

    Hi I am getting exception ArrayOutOfBound exception for one of my image sample that i tried. The code snippet is src is a BufferedImage. IndexColorModel icm = (IndexColorModel)src.getColorModel(); int numBands = 3; if(icm.hasAlpha()) numBands = 4; by