How to run my class without SDK

hi,
I wrote a swing application. I created myclass.class
Now I want to send it to my friend so they will be able to run this and use it.
I tried to test this on computer that doesn't have SDK but has only JRE (latest version).
I put the class is in folder c:\test
when I run the cmd:
java -cp c:\temp myclass
or
javaw -cp c:\temp myclass
(I tried also
"C:\Program Files\Java\j2re1.4.2_06\bin\java.exe" -cp c:\temp myclass
again - nothing happens!!!)
nothing happens!!!!
my question:
How can I run my application on computers that has only JRE?
Please help.
Thanks

OK - problem solved.
due to path ver - it used the wrong class.
Thanks any way - and have a nice weekend.

Similar Messages

  • How to run java servlet without using Web.xml?

    How to run servlet without using Web.xml? From a book, I know that web.xml descriptor is optional, but the book doesn't tell us how to run java servelet without web.xm descriptor. So how to do that? Thanks a lot.

    How to run servlet without using Web.xml?But Tomcat now uses a web.xml for its global server-wide configuration.
    If you'd like to invoke a servlet with:
    http://host/servlet/ServletName
    you have to enable the invoker servlet.
    [from an HTML]
      <FORM METHOD="POST" ACTION="/servlet/HGrepSearchSJ">
    [from resin.conf of Resin Web Server 2.1.12]
      <!--
         - The "invoker" servlet invokes servlet classes from the URL.
         - /examples/basic/servlet/HelloServlet will start the HelloServlet
         - class.  In general, the invoker should only be used
         - for development, not on a deployment server, because it might
         - leave open security holes.
        -->
      <servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
    [from TOMCAT5.0.19/conf/web.xml, a global server-wide web.xml file]
      <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
      <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
      <!-- servlet is mapped to URL pattern "/servlet/*", but you can map it    -->
      <!-- to other patterns as well.  The extra path info portion of such a    -->
      <!-- request must be the fully qualified class name of a Java class that  -->
      <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
      <!-- of an existing servlet definition.     This servlet supports the     -->
      <!-- following initialization parameters (default values are in square    -->
      <!-- brackets):                                                           -->
      <!--                                                                      -->
      <!--   debug               Debugging detail level for messages logged     -->
      <!--                       by this servlet.  [0]                          -->
        <servlet>
            <servlet-name>invoker</servlet-name>
            <servlet-class>
              org.apache.catalina.servlets.InvokerServlet
            </servlet-class>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>
    ---comment out below----------------------------------------------------------
        <!-- The mapping for the invoker servlet -->
    <!--
        <servlet-mapping>
            <servlet-name>invoker</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
        </servlet-mapping>
    -->

  • How to run the form without logon?

    sir:
    I want to create the application without logon,but before the
    form appear,I must logon, I want to know how to run the form
    without logon(comment:I don't connect to database!);
    null

    steve (guest) wrote:
    : Create trigger ON-LOGON. Supply alternative logon code
    : or NULL; if you want to do nothing. Form will execute
    : but will not produce logon window.
    : gang lee (guest) wrote:
    : : sir:
    : : I want to create the application without logon,but before
    the
    : : form appear,I must logon, I want to know how to run the form
    : : without logon(comment:I don't connect to database!);
    Mr steve,thanks for your help!
    null

  • How to reference a class without using the new keyword

    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();

    quedogf94 wrote:
    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();No.
    Using new does not erase anything. There's nothing to erase. It's brand new. It creates a new instance, and whatever that constructor puts in there, is there. If you then change the contents of that instance, and you want to see them, you have to have maintained a reference to it somewhere, and access that instance's state through that reference.
    As already stated, you seem to be confused between class and instance, at the very least.
    Run this. Study the output carefully. Make sure you understand why you see what you do. Then, if you're still confused, try to rephrase your question in a way that makes some sense based on what you've observed.
    (And not that accessing a class (static) member through a reference, like foo1.getNumFoos() is syntactically legal, but is bad form, since it looks like you're accessing an instance (non-static) member. I do it here just for demonstration purposes.)
    public class Foo {
      private static int numFoos; // class variable
      private int x; // instance varaible
      public Foo(int x) {
        this.x = x;
        numFoos++;
      // class method
      public static int getNumFoos() {
        return numFoos;
      // instance method 
      public int getX() {
        return x;
      public static void main (String[] args) {
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ();
        Foo foo1 = new Foo(42);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ();
        Foo foo2 = new Foo(666);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ("foo2.numFoos is " + foo2.getNumFoos ());
        System.out.println ("foo2.x is " + foo2.getX ());
        System.out.println ();
    }

  • How to run a Plugin, without opening Adobe indesign

    Hi,
    Does anyone know how to run a plugin as a service or something like that...
    What i want to do is,
        I have written a plugin that can read texts from indd files & save them as .txt files.
    now i want to put indd files in to a folder & once a new file comes to the folder, read that new file automatically  and save as txt.
    for that I want to run the plugin, without opening the indd file.
    I hope CS6 SDK support to do that.
    Please let me know if anyone has any idea...
    Thanks.

    Hi Menan,
    Thank you very much for your reply...
    I'll explain you what my requirement is,
    My final goal is to run the Indesign application(including my plugin) in a server &  put all indd files in to a location(ex.folder) &
    once an indd file comes to that folder it'll be automatically read by Indesign application & save the extracted data in a separate location(ex.another folder) as tex files. then human interaction is not needed...
    My precsent problem is,
           Can I read an indd file, without opening indd file in Indesign application (may be giving a path to a indd files included folder or some way like that).
    Currently,
      first i open the Indesign Application -> Open the indd file(intended to be read) -> Run my plugin.
    Now I Get the document with,
    IDocument* document = Utils<ILayoutUIUtils>()->GetFrontDocument();
    But what I want is,
    while the Indesign application is running on a PC, if an indd file comes to a given location(folder) it to be read automaticaly without opening my pluging.
    To do that My idea is,
      * Any time when the Indesign apllication is opend my plugin should automatically start running,
    * once a new file comes to a given location(folder) plugin shoud be automatically triggered & read the file.
    Please help me with your ideas..
    Thanks.

  • How to run a programm without dos-box

    hello everybody,
    if have got a "simple" question:
    How to run a java-programm under windows without an dos-box?
    Whenever I start an programm from a batch-file a console is opend, I dont need that console and want it to disapear!
    can anyboby help me? are there special tool or anx tricks?

    ... and remember to call exit in the batch file, otherwise it may stay visible.

  • How to run WMI class.method?

    How to run Enable()/Disable() methods using Win32_NetworkAdapter class?
    Method link: http://msdn2.microsoft.com/en-us/library/aa390385(VS.85).aspx
    This only part of solution. http://forums.ni.com/ni/board/message?board.id=170&message.id=165837&query.id=73951#M165837
    Thanks.

    You should be able to do this using a .vbs script and labview.
    See this thread for some .vbs examples.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=144519#M144519

  • How to run java .class file?

    How can i run/view .class file in java?. is there tool/utilities in java that can do that.?. Thanks

    Ednut wrote:
    I'm sure you must have been taught using the command: java yourClassName after navigating to the location of your compiled class in the command prompt.I'm sure the OP does not need condescending remarks from someone who knows almost as little Java as s/he does.

  • How to run a class file in MAC os, compiled in XP.

    Hi all,
    i am compiling a java program in windows using JDK 1.5 and i am copying this file to MAC os (Panther). In Mac i am running this class file using JDK 1.4.i am getting the following exception,
    Exception in thread "main" java.lang.UnsupportedClassversion error.
    This is understandable, but is there any solution for this ...
    Any one experienced the same problem ...
    If any one comes up with a solution to solve this, plz let me know...
    Thanks in advance......

    You are compiling it in 1.5 and expecting 1.4 to run it?
    You have two options: compile it at the 1.4 level or upgrade your Mac to 1.5

  • How to run java application without having java environment in  a machine

    can i run java application without having java environment(JVM) in a machine.I mean i dont have installed j2se or jdk in my machine.And i have an j2ee application running on another host which is built in swings.I want to access that application in my machine
    can any one help regarding my problem

    If you only need to access the program from one machine and you are running a Unix-like operating system (e.g., Linux, Solaris), you can use the remote display capabilities of X11. In this case you have to choose the host where the app will be displayed when you start it:
    $ DISPLAY=<hostname>:0.0
    $ export DISPLAY
    $ java ...
    If you want to be able to display it on both machines at the same time, or if you are using windows, then try something like VNC (http;//www.realvnc.com). Or if you are running windows and your version supports it, you can use windows remote desktop.

  • How to run the servlet without getting message window?

    while running servlet,i got a message window that 'Do you want to save:val?'how to rectify this problem while running servlet.
    Actually i saved the servlet files as HTTP and Generic.java respectively.
    In web.xml file,the content is as follows
    <servlet>
    <init-param>
         <param-name>title</param-name>
         <param-value>GenericServlet Example</param-value>
         </init-param>
         <init-param>
    <param-name>heading</param-name>
    <param-value>Servlet Program</param-value>
    </init-param>
    <servlet-name>G</servlet-name>
    <servlet-class>Generic</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>H</servlet-name>
    <servlet-class>HTTP</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>G</servlet-name>
    <url-pattern>/generic</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>H</servlet-name>
    <url-pattern>/http</url-pattern>
    </servlet-mapping>
    ======================================================
    The html file is as follows
    <html>
    <body>
    <form action="generic" method="get">
    User Name<input type=text name=t1><br>
    Password<input type=password name=t2><br>
    <input type="submit" value="GenericServlet Output">
    </form>
    <form action="val" method="get">
    User Name<input type=text name=t3><br>
    Password<input type=password name=t4><br>
    <input type="submit" value="HttpServlet Output">
    </form>
    </body>
    </html>
    ======================================================
    I executed the servlet as http://localhost:8080/stalin/sample.html
    and clicked the sumit button in the html page.
    During that time i got a problem but not getting the output.The problem is I got a message window?
    can anyone help me clarify my doubt plz

    That would occur if either the content type in the header is wrong (e.g. it is not text nor image, those content types with which the useragent used is associated), or if you have set content disposition in the header to attachment instead of inline.
    So, doublecheck the headers.

  • How to run all slides without stop?

    I´m watching an online course made with Flash.The course consists
    of several chapters/slides. After every slide I have to press the play button
    to start the next slide, which is a huge interference
    How do I make all slides run without me having to start all of them manually??

    There are plenty of folks that design things that don't do what others expect they should.  These forums themselves are a grim example of that.  I, personally, wouldn't bother getting so worked up about it--there are far greater woes in life than presentations that don't play thru without using controls.

  • How to run several class files at the same time

    I have four class files, there's: cvnt1.class,cvnt2.class,cvnt3.class and cvnt4.class.
    I want to know how to write application for running all of those files together. thanks!

    Your question is still unclear - do you want to access code from those class files (just add all of them to classpath) or do you want to create number of threads or number of processes (one per class) and start code from each class simultaneously or something else?

  • How to run a class function on the click event ?

    Hi Tecs,
    i want tht when someone click on some paricular location on the form, then the class function must be called with some parameter, when someone click on some other location, the function should be called with different parameters.
    How this can be done , plz help.
    Thnx in advance.

    Almost every tag supports onclick .. For example h:panelGrid and even h:form.
    JSF<h:panelGrid onclick="document.getElementById('formId:hiddenActionId').click(); return false;">
        <h:form id="formId">
            <h:commandButton id="hiddenActionId" value="action" actionListener="#{myBean.action}" style="display: none;">
                <f:attribute name="param1" value="value1" />
                <f:attribute name="param2" value="value2" />
            </h:commandButton>
        </h:form>
    </h:panelGrid>MyBeanpublic void action(ActionEvent event) {
        String param1 = (String) event.getComponent().getAttributes().get("param1"); // returns "value1"
        String param2 = (String) event.getComponent().getAttributes().get("param2"); // returns "value2"
        // do your thing
    }[EDIT]You really cannot avoid JavaScript. Heck, JSF itself also generates a heap of JavaScript ;)
    Message was edited by:
    BalusC

  • How to run a subVI without poping up normally, but when clicking a button, popup the front panel?

    I know pop-up the front panel of a subVi when called by selecting VI Properties>>Windows apperence.
    But what I need to do is: always run the SubVI inside the parent VI as the nornal subVI do without poping up. But when I click a button"show front panel", the SubVI popup the front panel.
    Is there anyway to do this?
    Thanks,

    ossoo,
             You can use a static VI reference to the subVI and then use the Front Panel Open invoke method to show the front panel when you want. I have attached two VIs that show this. I saved these VIs for LabVIEW 2009 so you should be able to open them up and run them in 2009 or later. Add.VI is the subVI that you are calling. The Caller.VI is just a While Loop that contiually calls the Add subVI. Inside of the While Loop is also a Case Structure with a Static VI Reference (you might need to change the path this is pointing to after downloading the VIs to your computer for this to work) and the Front Panel Open invoke method. You can run the Caller.VI and interact with the main Front Panel as normal and see the subVI but then you can click the Open subVI? boolean button and it will open the subVI's front panel. You can continue to interact with the main front panel and see the values update on the subVI's front panel as well. You can just close the subVI's front panel when you are done viewing it. Does this help?
    Grant H.
    National Instruments
    LabVIEW Product Marketing Manager
    Attachments:
    Caller.vi ‏19 KB
    Add.vi ‏23 KB

Maybe you are looking for