Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13595

Re: Self-executing JAR

From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: Self-executing JAR
Date 2012-04-16 14:51 -0700
Organization A noiseless patient Spider
Message-ID <jmi48t$nsp$1@dont-email.me> (permalink)
References <tvpoo7h83ooo9dk54gghqg8v805mlrkpf3@4ax.com> <i90po791d7luqcjsm4k2h5eoa72i23g8af@4ax.com>

Show all headers | View raw


On 4/16/2012 1:34 PM, Tim Slattery wrote:

> I export "Main.jar". To invoke from the command line, I type
> "Main.jar". Nothing but a command prompt. I have jedit installed. If I
> go to its directory and type "jedit.jar", it jumps right up. Therefore
> I assume that the JRE can be found.


OK, I tried it and I get the same behavior.  BTW, this is what I mean 
when I ask "show us the command line":


C:\Users\Brenden\Dev\proj\hw\dist>hw.jar

C:\Users\Brenden\Dev\proj\hw\dist>java -jar hw.jar
Hello world!

C:\Users\Brenden\Dev\proj\hw\dist>

That's cut-and-paste directly from my window on my computer.  It's easy 
to do, saves typing, and most importantly avoids typos when you're 
trying to ask a technical question.  Learn how to do it (use Google).

So I tried it with a new GUI app I made (just shows a dialog box with 
"Hello World!") and that displays the dialog, but there's still no 
console output.  So I'm sure I have the file association set, and 
further I'm still seeing the same behavior as you.  I'm guessing this is 
Microsoft interacting poorly with other vendors' products, and leave it 
at that.  File a bug report if you believe that will help.  Meanwhile, 
just use the "java -jar" command like I did above.

For others who might like to test this, here is the GUI test version:


package hwgui;

import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;

/**
  *
  * @author Brenden
  */
public class Hwgui
{
    public static void main( String[] args )
    {
       SwingUtilities.invokeLater( new Runnable()
       {
          public void run()
          {
             JOptionPane.showMessageDialog( null, "Hello World!");
          }
       } );
       System.out.println( "Hello World!" );
    }
}

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Self-executing JAR Tim Slattery <Slattery_T@bls.gov> - 2012-04-16 14:46 -0400
  Re: Self-executing JAR Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-16 12:21 -0700
  Re: Self-executing JAR markspace <-@.> - 2012-04-16 12:22 -0700
  Re: Self-executing JAR Tim Slattery <Slattery_T@bls.gov> - 2012-04-16 16:34 -0400
    Re: Self-executing JAR Lew <lewbloch@gmail.com> - 2012-04-16 14:26 -0700
      Re: Self-executing JAR "John B. Matthews" <nospam@nospam.invalid> - 2012-04-16 21:06 -0400
    Re: Self-executing JAR Knute Johnson <nospam@knutejohnson.com> - 2012-04-16 14:35 -0700
    Re: Self-executing JAR markspace <-@.> - 2012-04-16 14:51 -0700
      Re: Self-executing JAR markspace <-@.> - 2012-04-16 15:00 -0700
      Re: Self-executing JAR Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-04-17 08:31 +0000
        Re: Self-executing JAR markspace <-@.> - 2012-04-17 07:35 -0700
    Re: Self-executing JAR Lew <lewbloch@gmail.com> - 2012-04-16 15:51 -0700
      Re: Self-executing JAR Tim Slattery <Slattery_T@bls.gov> - 2012-04-17 08:56 -0400
    Re: Self-executing JAR Tim Slattery <Slattery_T@bls.gov> - 2012-04-17 10:49 -0400
      Re: Self-executing JAR markspace <-@.> - 2012-04-17 07:57 -0700
        Re: Self-executing JAR Tim Slattery <Slattery_T@bls.gov> - 2012-04-18 09:06 -0400
  Re: Self-executing JAR Roedy Green <see_website@mindprod.com.invalid> - 2012-04-17 04:24 -0700

csiph-web