java service dont work - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

andreso34
Posts: 1
Joined: Wed Aug 15, 2007 10:16 pm

java service dont work

hi,
This code works fine but when i try create msi java service dont works

please help me, thanks.




package zzz;

import java.io.InputStream;
import java.io.OutputStream;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketTimeoutException;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/*
* Java Service Example
*/
public class JavaService {
static boolean running = true;

/*
* Prints Hello to client and close the connection
*/
public static void main(String[] argv) {
while (running) {
JOptionPane.showMessageDialog(new JFrame(),"hilo is running...","RUN",JOptionPane.ERROR_MESSAGE);
System.out.println("hilo is running...");
}
}

public static void stop() {
running = false;
}
}
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

First note that a service does not have UI. You display a dialog that most probably blocks the main thread.

For a java service example please see:
http://www.advancedinstaller.com/user-g ... rvice.html

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”