I want to run a java application once only.Pl help.

i want to run a java application once only.
i.e. if some application is running on Win NT OS then that
particular appliaction again should not run,but other java application can run.
Pl help with some sample code.
Thanx.

Hi,
I if understood your question then your requirement is to run the application when the system is on.If this is the case then you can configure your OS schdular to do the job an let the OS do it.You can
write the java code for this but that will require to run on the OS layer,so better to configure the schedular setting.....But then for some other requirement it cannot be useful....
think...
regards vicky

Similar Messages

  • Running a Java application from a Swing GUI

    Hi,
    I was wondering if there is a simple way to run a Java application from a GUI built with Swing. I would presume there would be, because the Swing GUI is a Java application itself, technically.
    So, I want a user to click a button on my GUI, and then have another Java application, which is in the same package with the same classpaths and stuff, run.
    Is there a simple way to do this? Do any tutorials exist on this? If someone could give me any advice, or even a simple "yes this is possible, and it is simple" or "this is possible, but difficult" or "no this is not possible" answer, I would appreciate it. If anyone needs more information, I'll be happy to provide it.
    Thanks,
    Dan

    I don't know if it is possible to run the main method from another Java app by simply calling it...
    But you could just copy and paste the stuff from your main method into a new static method called something like runDBQuery and have all the execution run from there.
    How does that sound? Is it possible?
    What I'm suggeting is:
    Original
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void main(String[] args){
    // Your method calls
    //Your initializing
    doQuery();
    }Revised:
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void doMyQuery(){
    // Your method calls
    //Your initializing
    doQuery();
    // No main needed!!
    //public static void main(String[] args){
    // Your method calls
    //doQuery();
    //}

  • Is it possible to run a java application within a web browser?

    Hello everyone here! I have a question about running a java application within a web browser and I would appreciate it very much if anyone here can give me some answers.
    I have a standalone java application written with AWT. Basically this free application lets users to select spectral lines from a big file based on some criteria and plot those selected lines. Yes, it is a very simple application. Now I want to run this application within a web browser so that users don't need to download the application from the ftp site and thus don't need to install in their machine. Is it possible to run this application within browser? If yes, can we get the same plotting function as we run the application separately and where should I start out?
    Thanks in advance!
    kuilian

    Please see the signed applet discussion group for details of how to avoid the applet security restrictions. You can sign the applet, or use the policy file containing {AllPermission} for testing purposes (though not suitable for widespread deployment).
    Regards
    Matthew

  • How do i run a java application in jdk1.3

    im trying to run a java application in jdk 1.3. I created it in jbuilder and i was trying to use the applet viewer.

    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/appletviewer.html
    Jesper

  • How can I run a java-application on starting of Windows 2000

    How can I run a java-application without any user on starting of Windows 2000?
    For example, if the computer is restarted and nobody enter into it yet, my java-application should run anyway.
    How can I do that?

    Hi, you have to put it in a Windows service.
    To do this you have a program, Srvany.exe that allow to insert a .exe or .bat program in a Windows service.
    For example, i develop a program, TomcatGuardian and i put it in a service because i need to run it in a server without Administrator logged in.
    Regards,
    Ivan.

  • Running a java application from a java application

    hello ,
    please who knows how i can run a java application 'B' from inside another java application 'A' and get the error messages (if any) from the application 'B'

    how are you executing application B from application A? Please explain the java code you are using?

  • Running a java application in command prompt

    hi, I'm new to this forum.
    I would like to know what exactly needs to be specified to run a java application in a normal DOS command prompt.
    I know it is something like:
    javaw -classpath .\class GUI.applicationGUI
    where applicationGUI is the main class, right? What else do I need to do, since I have some other non-GUI classes that I need, inside the class folder ?
    Thanks for your time.

    You need to import those classes. And you need to make packages.
    In classes 1, 2 and 3 put:
    package class;
    In class 4 put;
    package class.GUI;
    Then you need to make the connection:
    In classes 1,2 and 3 put:
    import class.GUI.*;
    In class 4 put:
    import class.*;
    Compile each directory separately while in the respective directory. javac *.java
    Then go back to the directory above the directory "class" and run
    java class/GUI/name_of_file_containing_main_method

  • Can we run a java application using Runtime.exec()?

    Can we run a java application using Runtime.exec()?
    If yes what should i use "java" or "javaw", and which way?
    r.exec("java","xyz.class");

    The best way to run the java application would be to dynamiically load it within the same JVM. Look thru the class "ClassLoader" and the "Class", "Method" etc...clases.
    The problem with exec is that it starts another JVM and moreover you dont have the interface where you can throw the Output directly.(indirectly it can be done by openong InputStreams bala blah............). I found this convenient. I am attaching part of my code for easy refernce.
    HIH
    ClassLoader cl = null;
    Class c = null;
    Class cArr[] ;
    Method md = null;
    Object mArr[];
    cl = ClassLoader.getSystemClassLoader();
    try{
         c = cl.loadClass(progName.substring(0,progName.indexOf(".class")) );
    } catch(ClassNotFoundException e) {
    System.out.println(e);
         cArr = new Class[1] ;
         try{
         cArr[0] = Class.forName("java.lang.Object");
         } catch(ClassNotFoundException e) {
         System.out.println(e);
         mArr = new Object[1];
         try{
         md = c.getMethod("processPkt", cArr);
         } catch(NoSuchMethodException e) {
         System.out.println(e);
         } catch(SecurityException e) {
         System.out.println(e);
    try {            
    processedPkt = md.invoke( null, mArr) ;
    } catch(IllegalAccessException e) {
              System.out.println(e);
    } catch(IllegalArgumentException e) {
              System.out.println(e);
    }catch(InvocationTargetException e) {
              System.out.println(e);
    }catch(NullPointerException e) {
              System.out.println(e);
    }catch(ExceptionInInitializerError e) {
              System.out.println(e);
    }

  • Proble regarding running a java application

    hi guys
    i'm new to java environment .
    when i'm running a java application in a console ,
    it is not able to give output in other directories.it is working only in c:\j2sdk\bin.
    i think its the problem of setting classpath.
    can any one help me hw to run java program in any folder.

    You need to add that directory to your PATH. Follow
    the installation instructions more completely.Howdy sheriff Warnerja! How's life in the Schmuckville Home of the Ball-less? Any leads regarding the dot flasher case? I see you're on the PATH.
    Sheriff Warnerja of Schmuckville sensed an indecency plot.
    Here was someone exposing her private dot.
    He went on the trail,
    but of no avail:
    He didn't know where to find that intimate spot!

  • Running a Java Application in Windows

    Hi, Can anyone tell me how to run a Java Application in Windows? I've tried to run it using TextPad 4.5 but it gives me an exception saying it can't find a class defenition. I'm actually using IBM VisualAge for Java to develop the app and it runs fine INSIDE VisualAge and I've exported my compiled class files and so on, to run it stand-alone in Windows. I'm using some custom objects and inner classes, could these be the problem?

    YES! SUCCESS! I exported my class files from VAJ and along with the manifest file that it adds automatically. I opened up the jar with Winrar, extracted the manifest file and added the Main-class: header pointing to my executable and then put it back in the jar with winrar. And PRESTO! I can now run it with javaw! Thanks for your help peeps...

  • Running a Java application on a server.

    I made a simple Java app that acts as a server. I can't figure out how to run it though (well, I can run it on my own machine of course, but that's no good). I've looked into servlets but I get the impression that a servlet is for the web, while I want to run a socket-based program. Do I need a special server, or is myjavaserver.com (for testing) good enough?
    Thanks

    I don't want to run the application on my home machine because I don't want to leave it on all day, my internet connection is not as fast as a hosting provider's, and I don't like leaving a port open all day (although probably nothing will happen).
    So if I have a small app like import java.net.*;
    public class ServerTest {
         public static void main(String[] args) throws Exception {
              int port = 12345;
              ServerSocket servSock = new ServerSocket(port);
              while (true) {
                   Socket socket = servSock.accept();
                   System.out.println("Connection to server established.");
    } how would I run that on a hosting provider's server? At home I can just call "java ServerTest" from the command line, but for obvious reasons I cannot do this on a web server that I do not have physical access to.

  • Running a Java application from web browser

    Hi,
    I'm not sure if this is the right place to put this, and it probably isn't, but I don't really know what else to do at the moment.
    I have a problem. I've written all these nice and pretty Java applications that do all this complicated junk that makes me proud. However...I have no idea how to actually run those applications.
    I've looked at guides on Java applets, Java Web Start, Java Server Pages, etc, and I still am not sure. JSP looked like the best option, until I figured out I can't use it with my web server. So, I've pretty much hit a wall here.
    If anyone could shed some light on this, I would be very appreciative. All I want is for a certain application to run when a user clicks a button on a simple HTML page. That's all I want...yet it seems so hard.
    Is there a simple way to do this, or do I need to use JWS or something and configure all these JARs and JNLP and classpaths and everything under the sun (no pun intended)?
    Again, I apologize if there is a better forum for this; I am just very confused right now and feel like I've hit a brick wall. If anyone can give me any advice, or point me in a good (easy) direction, I would truly be grateful.

    If anyone could shed some light on this, I would be
    very appreciative. All I want is for a certain
    application to run when a user clicks a button on a
    simple HTML page. That's all I want...yet it seems so
    hard. There's a lot of hidden details that make it so hard. What computer will run the application when the button is clicked? If the application will run on the client computer (within the web browser) there has to be a mechanism for allowing arbitrary code to be downloaded, verified and executed on any number of different target platforms. This is the problem that Java Applets address. Mostly this is a security issue, since a simple HTML page being able to run arbitary code without user interaction or approval is going to cause the world to be overrun by computer virii. There's also the multi-platform issue, but in many cases that can be avoided by requiring the client to use a single platform (the MS approach).
    If the application will run on the server, then the client code is much less difficult, as only a basic web browser is needed, and the server code is complicated, since it needs to keep track of multiple clients at the same time and process data in a request-response fashion.
    From the end-user's point-of-view, it certainly is simple though. Press the button and voila!
    "Any technology which is distinguishable from magic is insufficiently advanced"
    Brian

  • Run Webdypro Java application by default

    Hi ,
    Is that possible to run a Webdynpro Java application by default when User logs into Portal?
    Actual requirement is that we need to assign Users with different ume groups once User login to portal depending on some User attributes.
    I am thinking adding the developed WD application to default frame work page will that work?
    Many Thanks
    Chandra.

    Hi Chandra,
    You can always modify the login page. So, when a user logs into a page, you can write custom code to be implemented - jspDynPage for login is modified.
    Now, to implement sync between UME and Corporate LDAP, you could have a scheduled program in background(Java Scheduler) which runs everyday to sync the UEM data with LDAP data.
    Now the tricky part. To trigger a background process as and when the user is managed in UME we need to find a way to alter the standard UME page. Not so sure if SAP allows us to do it.
    Simplest option, alter the login page. On the first time login(something your code should be able to determine), call the Java EJB/web service which will send this data to your LDAP.
    Regards,
    Sharath

  • How can i run my java Application stand alone?

    Dear all,
    As the topic i want to run my application in a single file without showing the dos prompt or type in the command in dos prompt by the user......
    How can i do that, since in my application , i have used so other package?
    In fact i just want to do something like just run a executable file in windows.
    Thx

    Sounds like your JRE didn't install properly. Either reinstall it or you can enter the file association manually.
    On Windows NT (it may be different on other versions of Windows) take the View/Options menu item from an Explorer window
    Click on the File Types tab.
    Click the "New Type" button.
    Give it the name "Executable jar file" and an associated extension of jar
    Click the "New.." button
    Make the action open
    Make the application something like
    "C:\Program Files\Java\j2re1.4.0\bin\javaw.exe" -jar "%1"
    changing it for your installation.
    Col

  • Impossible run a Java application on IBM J9

    Hello,
    i've installed cdc_toolkit-1_0-win.exe on my pc, and i want try "HelloXlet.jar" samples on my pocketpc with wm6 in which is installed IBM J9.
    I've copied "HelloXlet.jar" in J9\examples\ and i've created a .lnk file with inside
    255#"\J9\PPRO11\bin\j9.exe" "-jcl:PPRO11" "-cp" "\J9\PPRO11\examples\HelloXlet.jar" "HelloXlet"
    When i tap on lnk file it generates a beep and not appear nothing on my screen.
    How i can run an application with J9?
    Help me pls.

    I believe Windows98 has two programs, jview.exe and wjview.exe, you could use; however, they only support up to JDK1.1.4. So if the Java program does not written in JDK1.1.5 or up, you do not need to download anything. Otherwise, you need to download the JRE software in order to run the program.
    The newest JRE1.3 (supports IE6)
    http://java.sun.com/j2se/1.3.1/jre/
    The beta version of JRE1.4
    http://java.sun.com/j2se/1.4/jre/

Maybe you are looking for

  • New P6N Platinum acting wierd...

    What's up guys.  My dad's computer at his office has been giving him problems like locking up, sluggish performance even after a reformat, etc so he gave me $1200 to build him a new machine that will last him "a long time". hahah So I've put together

  • Viewing a pdf file in Flex 4?

    I've been searching on the Inernet to find out whether or not it is possible to view a PDF file (which will be stored in the server itself) on the client side... In the flex AIR they've a built in support to view a pdf file..but I'm not able to find

  • Need Help With Drivers for 488ca

    Hi I'm having nothing buy trouble I have a designjet 488ca and for the life of me can't down lode the soft ware they no longer make the CD and this thing is just keep going around with the same old crap I would be glad to pay for the CD if they just

  • Uninstall FCP 5.0 and reinstall 5.1 universal binary version on non intel

    I have a non intel G5 and just got another intel based Mac, i heard they have fixed the issus with compressor 2.0 in the new version of Final Cut Pro 5.1 which i have also bought and was wondering how to go about uninstalling and reinstalling FCP so

  • HT3964 What if  a mac pro spontaneously shuts down and won't restart

    Mac pro 2012. Happily working then stops. All attached powered devices like hard drives remain on. Not due to dodgy ac power because it's behind a 2kv ups with constant sine wave output. The ups looks like its barely ticking over. Reset the pmu accor