Cann't start Java Application

Hi, my main class called TemplateUtil. I have created TemplateUtil.jar and try to start my application:
javaw.exe -cp W:\eclipse\TemplateUtil\bin\de\qv\ec\servlets\util\TemplateUtil.jar;D:\jblibs\classes12.zip -Dfile.encoding=ISO8859_1 de.qv.ec.servlets.util.TemplateUtil.main
Error: could not find main class.
Why?

That's what I was wondering.
de.qv.ec.servlets.util.TemplateUtil.main
Isn't this actually saying there is a subclass called "main" inside TemplateUtil.
Shouldn't it just be:
de.qv.ec.servlets.util.TemplateUtil ??
I don't want to confuse the issue, but if someone could explain where de.qv.ec.servlets.util.TemplateUtil.main is valid let me know.

Similar Messages

  • Start Java Application

    What is the best way to start java application without a dos window ?
    And to install it

    You can create an "executable JAR file" (a JAR file which has a MANIFEST.MF file in it with some special settings) or you can start your application with "javaw" instead of "java" to prevent the DOS window from opening.
    Jesper

  • Start java application from jsp?

    is there any way i can have a JSP, bean or servlet start a java application on the server? maybe a better question is: what can i do to make sure that some class is always running on my javaserver? im talking about the server app. for a chat program that im making that will be an applet in a JSP page along with a load of other JSP pages that do other things...
    sorry for my incoherence. i usually talk better than this. :)
    Laz

    just replying so the message comes to the top of the forum... can anyone help me here?
    Thanks
    Laz

  • Failed to start  java application server  8

    hi every body,
    hi every body,
    i am getting the famous error:
    " failed to start sun java application server 8 possible causes:
    -port conflict
    -incorrect server configuration(domain.xml need to be corrected manually)
    -corrupted deployed application preventing server to start (domain.xml needs to be modified) "
    the thing is that i know the cause of error it is the 3rd one since i had some exception while running a project and since on this error was appearing,and i didnt know how to solve this problem i.e how to edit the domain.xml file
    so i uninstaled and reinstaled the java cretor a number of times every time i face the problem, but the last time i did so the folder C:\Sun\Creator\SunAppServer8\domain that contains the file domain.xml was not even there and i dont know why did that happen or how to solve it
    please help,
    regards.

    i too have a similar problem - mine seems to be related to MySQL access but I cant find any help on the problem - surely there is a better way than to continually re-install - on the previous version i could work it out without a re-install but not with the update.
    i havent found anything in the server logs - they are huge docs - i cant see how it can be a port conflict as its ok 1 minute and not the next.
    i just need a pointer to where to look ?
    thanks in advance

  • Starting Java application from other Java application..

    Hi all,
    I was wondering if it is possible to start a Java program from an other Java program.
    In Java program 1, I have this code to execute the other application:
    try {
        Process p = Runtime.getRuntime().exec("cmd /c java -cp JavaApp2.jar com.test.TestFrame");
    } catch (IOException e) {
    }I tried this code, but unfortunately I couldn't opened the other (JavaApp2.jar) Java Application. Is there a way to open the other application anyways?
    I really hope someone can help me. Help would be greatly appreciated! Thanks in advance.
    Tongue78.

    What if there is no JAR file?Then you can make it out of the .class files. And to anticipate your next question, if there are no .class files there is no application at all, so you can't exec() it or call the main() method directly. Your point?
    And JAR isn't part of the Java language.It is a major part of the Java platform.
    This means you can only get access to a JAR file via the OS. Wrong again. CLASSPATH. URLClassLoader.
    In short you cannot just shout main() in a Java program and hope some other Java program will hear you and start.Absolute rubbish. If the required classes are on the CLASSPATH you just call com.company2.app2.main(args) and off you go. Or you can load the main class and invoke its main() reflectively.
    No source code required, or 'source code merge' either.

  • Start java application from java program

    My problem is the following:
    I start a java application A that allows you to select a couple of .java files.
    After having choosen them, the application adds some additional information to these .java files (that means some more lines of code � we call it �infecting� the java files).
    After the files have been infected, I want to start the application B implemented by these choosen and infected .java-files (without a new start of the Java Virtual Machine)
    For doing so, we use the following method whichs works quite fine:
    public static void ExecuteWithInvoke(String path, String classname)
         try
              new URLClassLoader(new URL[] {new File(path).toURL()})
                   .loadClass(classname).getMethod("main",
                   new Class[] { String[].class }).invoke(null,
                   new Object[] { new String[] {} });
         catch (Exception e)
         {e.printStackTrace();}
    The only problem that occurs:
    When the application B is launched, the �old� version of the choosen .java files is used and not the current, already infected version of these files. (I guess because the �old� .class files are used.)
    I solved this problem by finishing the program A after the infecting and restart my application B manually. In this case the infected .java files are used (I guess the new Start of the Java Virtual Machine solves my problem by reloading the �new� .class files)
    How can I reach to start my application with the mentioned method but with the infected .java files and without having a new start of the JVM ??
    Can anybody help me?
    Thanks in advance
    Sorry for my English, it�s a long time since I quit school

    Hello,
    my problem of reloading classes is still unsolved although you tried to help me!
    Therefore I posted a little program to illustrate our difficulty.
    It would be nice if somebody could have a look at this program.
    We have a file Testdatei.java whose only method is the main method.
    I get the class object of this file and with the help of Reflection the declared methods.
    Evereything works fine so far.
    Then I change the content of this file by adding an additional method a() (see change() for this).
    Now I delete the old class file and I compile Testdatei.java again (see compileJava()) and once more I get the class object for this changed file. Afterwards I get the declared methods for this class via reflection.
    But instead of showing now the methods main() and a() Reflection still only shows the method main().
    I guess the changed class has not been reloaded!!
    package testpackage;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.lang.reflect.Method;
    import java.net.URL;
    import java.net.URLClassLoader;
    import com.sun.tools.javac.Main;
    public class LoadClass
         private File f;
         private Class c = null;
         private Object o;
         public LoadClass()
              f = new File("C:/AAJ/src/testpackage/Testdatei.java");
              try
                   o = neuesExemplar(f.getPath(), "testpackage.Testdatei");
                   c = o.getClass();
                   System.out.println("Class " + c.getName() + " found.");
              catch (Exception e)
              {e.printStackTrace();}
              Method [] method = c.getDeclaredMethods();
              for (int i=0; i<method.length; i++)
                   System.out.println(method.getName());
              change();          
              compileJava(f.getPath());
              File fileToDelete = new File("bin/testpackage/Testdatei.class");
              System.out.println(fileToDelete.delete());
              Class cla = null;
              try
                   Object o = neuesExemplar(f.getPath(), "testpackage.Testdatei");
                   cla = o.getClass();
                   System.out.println("Class " + cla.getName() + " found.");
              catch (Exception e)
              {e.printStackTrace();}
              Method [] methods = cla.getDeclaredMethods();
              for (int i=0; i<methods.length; i++)
                   System.out.println(methods[i].getName());
         private int compileJava(String javaFile)
         String[] args = {"-d", "C:/AAJ/bin/", "-classpath", System.getProperty("java.class.path"), javaFile};
         return Main.compile(args);
         public static void main(String[] args)
              new LoadClass();
         private Object neuesExemplar(String pfad, String klassename) throws Exception
         URL url = new File(pfad).toURL();
         URLClassLoader cl = new URLClassLoader( new URL[]{ url });
         Class c = cl.loadClass(klassename);
         return c.newInstance();
         private void change()
              FileWriter fw;
              BufferedWriter bw;
              try
                   fw = new FileWriter(f);
                   bw = new BufferedWriter(fw);               
                   bw.write("package testpackage;");
                   bw.newLine();
                   bw.newLine();
                   bw.write("public class Testdatei");
                   bw.newLine();
                   bw.write("{");
                   bw.newLine();
                   bw.write("public static void main (String [] args)");
                   bw.newLine();
                   bw.write("{");
                   bw.write("System.out.println(4);");
                   bw.newLine();
                   bw.write("}");
                   bw.newLine();
                   bw.newLine();
                   bw.write("private void a ()");
                   bw.newLine();
                   bw.write("{");
                   bw.newLine();
                   bw.write("System.out.println(55);");
                   bw.newLine();
                   bw.write("}");
                   bw.newLine();
                   bw.write("}");
                   bw.close();
                   fw.close();               
              catch (IOException e)
              {e.printStackTrace();}                                             
    I�m using eclipse 3.1.0. Is it possible that it�s a bug in eclipse that eclipse holds the old class file in memory from the beginning and always refers to this one and not to the new compiled one?
    Thanks a lot
    Simon

  • Apache Tomcat goes down on starting Java application, Oracle error

    Hello all
    I am running a Java application on Apache Tomcat 5.5. I use Oracle 10g Express Edition as the back-end for my application. I deploy my application using theTomcat manager and it works fine.
    However, when I try to access the home page of the application, my Tomcat server goes down. The stdout logs of Apache Tomcat display the following message:
    Exception message: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-12705: Cannot access NLS data files or invalid environment specified.
    What could the possible reasons be for this to happen? And how can I workaround or fix this?
    Thanks
    Swetha

    This looks like a problem that XE has with some recently altered locales, i.e. Russian. You can work around the problem by making sure that the Java locale (Locale.setDefault()) is supported by XE before the JDBC connect call. For example, use Locale.setDefault( Locale.US ). After connect, you may explicitly set session NLS parameters using ALTER SESSION. You can also restore the Java locale.
    -- Sergiusz

  • Batch file to start java application

    Hi All,
    I have created a batch file to start my application.
    startApp.bat
    javaw myclass
    But now the problem is the command prompt is not closing. I want the command prompt to close automatically. Any help??
    Thanks in Advance,
    Manjinder Singh

    I cannot use double click on JAR file as i have some other commands also inside batch file. Like classpath setting etc.
    I tried to use cmd /c myapp inside batch file, but still the command prompts stays there till i exit my application.
    Any further HELP??

  • Start Java application at system start up linux/unix

    Hi,
    I am working on a application, which needs to run as a background process in linux/unix without the intervention of the user.
    Please give me the details procedure how to make it as background process.
    thanks

    you can make any process a background process by adding an amperstand
    for example:
    java -cp $MyClassPath myAppClass &
    If you want to run it automatically at startup
    you'll have to write a little script which is executed at startup
    and contains a line as above.
    The scripts exectuted at startup are usually located at
    /etc/init.d
    You can use one of those scripts as starting point for your own script.

  • Start java application from another programm

    Hi everyboda on this side,
    i got a big problem. I would like to start out of MS excel an java programm and I would like to hand over data from the MSexcel programm to the java programm. I hope someone can help me. My idea was to create a batchfile, which I start from the excel-programm to run the java programm, but how do I hand over the data from excel to java?
    In advance thanks to all the ones, who tried to help me - max

    You could try to use a JDBC-ODBC bridge that allows you read the data of your excel file.....
    Here, a guide for use it:
    http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html
    Hope this helps.

  • How do I start and suspend Java Application from say C++ program

    I want to start a Java application via C++ and on some condition i want to suspend the same program not terminate , but suspend

    Have you tried running the virtual machine from your C++ application ? You can start Java applications from your C++ application using JNI after starting the Virtual machine from within your C++ application. According to the Java documentation you can even now stop the virtual machine from within your C++ program.
    I haven't looked at the 'suspend' detail but I suppose it will not be a problem to call a method via JNI to set a flag to suspend a thread etc.
    There is a tutorial: 'Invoking the Java Virtual Machine' at the following URL: http://java.sun.com/docs/books/tutorial/native1.1/invoking/invo.html.
    This example seems to work only for version1.1 of the JDK. For JDK1.3, version 1.2, (I am not so sure whether I fully understand Sun's version numbers for Java yet) there is some updates on the JNI for starting the VM from C++. This article is called 'JNI Enhancements'. The URL for this article is:
    http://java.sun.com/j2se/1.3.0/docs/guide/jni/jni-12.html
    You have to set version to: JNI_VERSION_1_2
    There is only one problem. I get an error when calling JNI_CreateJavaVM from C++. I could not find any documentation that indicates how you can go about diagnosing what is causing the problem. Normally in Visual C++ you can just get the probable cause by inspecting GetLastError() or the function itself can return helpful diagnostic (error) codes.
    If you manage to start the VM correctly from within Visual C++ please let me know. My email address is [email protected]
    good luck
    Henko

  • Could not start Sun Java Application Server

    Hi ,
    I have been using JSC for a while, now and then it reports an error " could not start sun java application server...". Does any one know why it s not able to start java application server..
    Before you say anything, I have tried
    1. use netstat to find any port conflicts.
    2. Tried to start application server manually
    3. shut down and start studio creator and then try running the project
    4. shut down and start PC
    unfortunately none of them helped
    Only reinstalling resolved the problem. But I cant keep reinstalling very often.
    Does any one know the permanent solution for this problem.
    Cheers
    kush

    Sometimes it appears this is a timeout issue because it's taking too long to come up. As Jonathan says, undeploy can help with this (along with his other suggestions).
    How many deployed projects do you see (in the server navigator you can open up the deployed server and see what's out there)?
    I periodically undeploy "junk" projects that I'm not really using because they slow down the server startup (same thing happens I believe for tomcat... when the server starts it has to load them all and it takes awhile). You can undeploy from within the server navigator by drilling into the server nav and right clicking on the deployed app and choosing undeploy... or you can use the server admin tool.
    hth,
    v

  • Java application updating itself

    Hi,
    I'm making update manager program for my Java application.It downloads updated jarfile from the net and that file should replace the file being currently used.
    Could someone give a hint what would be the best way to modify the jar-file that is currently being used by virtual machine (or is there any).
    The optimal way would be that the code in the original jar file could somehow change itself (and then restart etc) but failing that the second best alternative would be making a second java -aplication which does the updating. In that case I'd need an advice how to start java application from another application in device indepentend way (prefereably not with Runtime.exec().
    Thanks in advance.
    r2

    The best way would be to use Java Web Start, which does all of that, instead of writing your own.

  • Bat file only way to run java application

    hi,
    is there exists any other way to(other then writting java applic.class in a bat file) execute the java programs,of course other then writting java applic.class to command prompt.
    thanks 4 reply
    kk

    Sometimes i write exe files (for windows) in C to start Java applications. The exe file calls a simple ShellExecute( "java", "-jar blah blah" );
    If you use a C compiler for Windows, you prevent the command line box to appear.
    Regards,
    Oliver

  • Java Application in ERROR State not stopable - how to remove?

    Hi,
    I have created a Java Application and published to the HCP Trial. After successful testing I stopped and uninstalled the App and the respective assets (e.g. database Schema) Nevertheless this process was interrupted by the shutdown of the landscape for maintenance 2 days ago. Now the App is visible again in the Cockpit with state "Application Error" - when I try to stop it nothing is happening. If I want to go to the details screen of that application it also does not come up and still shows the table of all the applications.
    As you can only have one started Java Application in the Trial - I am really keen on getting to know how to stop that application to be able to go on with other tests.
    Any Guides - or any possibility to stop/delete the application?
    Thanks in advance,
    Arne

    Hi, here are the screenshots of settings and error:
    (If I change the application name here without changing any other settings I am able to successfully create a new application on the server)

Maybe you are looking for

  • Server 2012 Hyper-V locks up Virtual Server for no reason.

    Server 2012 Hyper-V locks up virtual servers for no reason. This is a production server. I began building this server in February. I installed the server in November. 2012 server R1 is full of bugs! First who was the rocket scientist that decided tha

  • Common Abbreviations Used When Setting Up and Troubleshooting HP Printers

    Here is a list of common abbreviations and phrases used while trying to troubleshoot network-connected printers within the forums and other web-based support documents: Ad Hoc –  Latin phrase meaning "for this" and is used when describing a type of c

  • Table of Contents Slider Issues

    I have been told by iBooks that on my iBook that I have published that when you look at The TOC (Table of Contents) in landscape mode the slider either doesn't move or it goes back to the first page (copyright page).  Any ideas how I solve this? 

  • How to restore last change ?

    Hello, my phone is stolen and removed me from my iphone. Сan you help me ? Or how to restore my last change ? ... thx for understanding...

  • P67A-GD55 (B3) Wont Post

    Hi guys, This has been my first build with msi board and has turned out to b a pain in the u kno what lol. I wanted a Sandybridge upgrade so got all my new components delivered the other day. core i5 2500k, msi P67A-GD55 (B3) and 8gb (2x4gb) corsair