Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: i want run app as windows service.

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question i want run app as windows service.

    Hi i have problem with run windows service i using Procrun. I made by exsample
    Build windows service from java application with procrun Jörg Lenhard's Blog
    My code is
    public class App extends Thread {
     
    		private static boolean stop = false;
     
    		public static void start(String[] args) {
     
    			ReadThread readThread = new ReadThread();
    			readThread.setDaemon(true);
    			readThread.start();
    			while (!stop) {
    				try {
    					Thread.sleep(1000);
    				} catch (InterruptedException e) {
    				}
    				System.out.println("running");
    			}
    		}
     
    		public static void stop(String[] args) {
    			System.out.println("stop");
    			stop = true;
    		}
     
    		public static void main(String[] args) {
    			if ("start".equals(args[0])) {
    				start(args);
    			} else if ("stop".equals(args[0])) {
    				stop(args);
    			}
    		}
     
    	}


  2. #2
    Junior Member
    Join Date
    Aug 2012
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: i want run app as windows service.

    I also try Run app as windows service. this example pls help.

Similar Threads

  1. Problem: Java App like window Service
    By toaries in forum Java SE APIs
    Replies: 2
    Last Post: August 30th, 2012, 02:06 AM
  2. Problem: Java App like window Service
    By toaries in forum Java Theory & Questions
    Replies: 1
    Last Post: August 29th, 2012, 09:30 AM
  3. Run a jar file inside a batch file with Windows 7 Task schduler
    By kingnachi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 15th, 2012, 09:20 AM
  4. My app audio sounds different when running the app?
    By TP-Oreilly in forum Android Development
    Replies: 1
    Last Post: January 29th, 2012, 08:23 AM
  5. How do i run this Accounting console app?
    By mirzahat in forum AWT / Java Swing
    Replies: 2
    Last Post: November 16th, 2010, 12:22 AM