Is it possible to run a JAR?

My high school Computer Science teacher thinks it might be possible to run a JAR file in windows and have it run the java program (command promt type) in windows. I do not believe this is possible but he wanted me to check and see.
Also is there any other way to run a java program in the form of class files without going through the DOS prompt or a compiler? Duke dollars if you know a way.

when you install the JRE it should associate jar files
with the JVM, hence double-clicking on them will run
them. but....well... strictly they become associated with javaw
to make a jar an executalbe jar it needs a
'main-class' attribute in the manifest. That is make
a directory that goes in to the jar called META-INF
and in there a file called manifest.mf (just a plain
text file).thought i had already mentioned that!
test from the command line with
java -jar myjarfile
or
javaw -jar myjarfiledouble-click issues an identical command - if it doesn't work one way then it won't work the other
the difference between the java and javaw is that the
javaw will not open a DOS window. true!

Similar Messages

  • Is it possible to run a jar file in another program???

    Hello members,
    i am sanketh. is it possible to run a jar file in another program.
    if possible plz reply with an example or good links to go thru.

    What do you mean "run a jar file in another program"? It's not very clear.

  • How can i run a jar file as EXE on mouse click..

    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*

    amrit_j2ee wrote:
    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*Do you mean converting it from a jar file to an EXE file or do you mean that you would like to run the application by just double clicking it?
    If it's the latter then you need to make the jar file including a manifest.
    The manifest can be just a txt file with its content to be something like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: Somebody
    Main-Class: NameOfTheMainClass
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildTo make the jar file including the manifest, use something like this in your command prompt (of course you must have compiled your java file(s) first):
    jar cfm test.jar MANIFEST.txt NameOfTheMainClass.classAfter that you'd be able to run your application just by double clicking it.
    If you're a NetBeans user, you can build your standalone application by right-clicking your project and then going to properties => run => and choosing a Main class. After that right click on that project and "Clean and Build", locate the jar file in the "dist" folder and double click it =]
    Hope it helps,
    LD

  • Button action - run separate jar file

    My first post here (hopefully many more to be:D) and I have an interesting question which I haven't thought out how to realize it.
    Imagine you run the NetBeans template for a sample GUI application. You add a button, and the action of the button when pressed to be to run another jar file (and maybe pass parameters to it).
    How can I do that? Or is it even possible? I know that it isn't simple as to import the other project and to set the action to "java -jar theotherapp.jar".

    Thanks for the fast reply and for the good suggestion.
    I think I'll try with ProcessBuilder (I used Java till recently only for data structures and similar, so all of these stuff -gui building, making desktop apps, is new to me :D people only have to be pointed into the right direction).

  • Is it possible to open a Jar within Java code

    Hey
    I am just wondering if it is at all possible to get java to run a Jar within the code. So the Jar is my update to my program and I have got it downloading from my site using the java code but now i want the code to open it for the user so they don't have to double click in on. Is this possible?
    Thanks

    Sure. The java.util.jar package.
    You might want to take a look at service providers:
    http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider

  • Is it a possible to run Java application built by JBuilder other than it?

    Dear All,
    I am expecting the quick response from you people.
    We have built our EJB application completely using JBuilder 9.
    Due to some license problem, there is a delay getting JBuilder original version .
    We dont want to waste our time to wait for JBuilder.
    So, is it possible to run our EJB application other than JBuilder???
    I tried to build the application thru Weblogic8.1, but failed to do so.
    Awaiting for your immediate response,
    Thank you,
    regards
    mani

    Hi,
    I've written build.xml for our application and tried to run thru Ant tool. Unfortunately, it is failed to compile, since there is some mismatch version it seems.
    It has thrown some compile time errors as below:
      [javac] C:\AMS1.7b\AMSWEB\AMSWEB\src\com\tf\AMS\xml\TTXmlWriter.java:574: cannot resolve symbol
      [javac] symbol  : method addChild (org.jdom.Element)
      [javac] location: class org.jdom.Element
      [javac]       udfRoot.addChild(secRoot);
      [javac]              ^
      [javac] C:\AMS1.7b\AMSWEB\AMSWEB\src\com\tf\AMS\xml\TTXmlWriter.java:1580: cannot resolve symbol
      [javac] symbol  : constructor XMLOutputter (java.lang.String,boolean)
      [javac] location: class org.jdom.output.XMLOutputter
      [javac]           XMLOutputter serializer = new XMLOutputter(" ", true);There is a latest Xerces.jar file under the jars directory, but it is unable to digest these methods! :-(
    When i tried to build the application thru Eclipse, it has thrown the following error:
    Buildfile: C:\AMS1.7b\build.xml
    clean:
       [delete] Deleting directory C:\AMS1.7b\AMSWEB\AMSWEB\build
    compile:
        [mkdir] Created dir: C:\AMS1.7b\AMSWEB\AMSWEB\build\classes
        [javac] Compiling 514 source files to C:\AMS1.7b\AMSWEB\AMSWEB\build\classes
        [javac] C:\AMS1.7b\AMSWEB\AMSWEB\src\com\tf\AMS\beans\A_Address_bean.java:3: cannot access java.io.Serializable
        [javac] bad class file: C:\Program Files\Java\jre1.5.0_06\lib\rt.jar(java/io/Serializable.class)
        [javac] class file has wrong version 49.0, should be 48.0
        [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
        [javac] import java.io.Serializable;
        [javac]                ^
        [javac] 1 error:-( :-(

  • Run a jar on Windows without the command window

    I would like to run a jar and close the command window after starting up. Is this possible please.

    I would like to run a jar and close the command window after starting up. Is this possible please.why do you want to do that? jar files are executable files so when you double click it, it will execute without having to run it from the command prompt. So, you don't have to even open the cmd prompt to run .jar files.

  • Html script to run a Jar file

    Is it possible to automatically run a .jar file from an .html page? Here is my issue:
    I have a software script for athletes that runs from a jar file. I need to create an index.htm file in order to use the compiler software that I am using.
    So I am trying to figure out if there is a script to put in the index file that will immediately run the main .jar file. I don't want the viewer (athlete) to even see the index file so the only code I will put in there will be to run the .jar file.
    Is this possible?
    thank you!

    This all sounds very confused.
    There are applets (Java applications embedded in a webpages).
    There are stand alone applications (Java applications that are by themselves no web page required)
    There are servlets ( Java applications that produce HTML pages [and other web content])
    This bit about my compiler needs it makes no sense. And I don't know which of the above you have or are trying to be honest. I will tell you this, it is one of them (probably the first two).
    So which one of those are you trying to make? If you say none of them then please think harder because that is not a valid answer.

  • Run a jar-File and modify a file within this jar-File

    I am running the jar-File, which contains my compiled java files etc.
    The program has a config part, which is saved in xml file.
    This xml file is in the same directory like the class files.
    All theses files are zipped as jar-File.
    Well, I am running the jar file.
    - But how do I open and save the xml file ?
    - Is that possible ?
    - How difficult ist that ?

    I tried to do this some time ago and found out the hard way that you can't, just as DrClap just told you. I would have taken his work for it anyway, but for what it's worth, I thought I'd mention that you're not alone. In my case I wanted to be cute and keep my properties all together within the .jar; thought it'd be cleaner that way. Ended up just creating the more typical class_name-props file in my home directory. Is this what you had in mind?
    ~Bill

  • [SOLVED]Java error running a .jar file

    Hi. I'm running Arch 64 and I keep getting this error when trying to run
    java -jar TwinkEdit-0.6.9.jar (from twinkle.sourceforge.net -- a flashcard program for palm. This .jar is the desktop editor for the flashcards. It's worked before on Linux ... but that was almost 2 years ago.)
    Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException
    at java.util.Vector.firstElement(Vector.java:442)
    at org.ekimd.twinkedit.TwinkUI.getJapFont(TwinkUI.java:979)
    at org.ekimd.twinkedit.TwinkUI$DynamicView.<init>(TwinkUI.java:589)
    at org.ekimd.twinkedit.TwinkUI.getDynamicView(TwinkUI.java:815)
    at org.ekimd.twinkedit.TwinkUI.access$1300(TwinkUI.java:88)
    at org.ekimd.twinkedit.TwinkUI$NewAction.actionPerformed(TwinkUI.java:1101)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6041)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5806)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4413)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2440)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    It happens in both 32 bit (arch32 chroot) and 64 bit jre's exactly the same.
    java -version gives:
    java version "1.6.0_07"
    Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)
    (It also doesn't work on Windows, either .... I think it must be a Java version compatibility problem ??)
    Any ideas?
    Thanks, 
    Scott
    Last edited by firecat53 (2008-09-27 14:07:04)

    I gave it a try and got the same error. Then I started looking at the code:
    When you create a new file, the program starts looking for a font which supports japanes (don't ask me why). If it doesn't find any it throws the error you posted above. I was able to create a new file after I installed ttf-bitstream-cyberbit from AUR (first font supporting japanese I could find).
    You should contact the author and submit a bug report. Even if the program really needs japanese fonts, which I doubt, failing like this is just bad.
    Last edited by Garns (2008-09-27 13:26:05)

  • Is it possible to run sub vi and main vi at same time from startup?

    Is it possible to run both my main vi and my two sub vi`s from startup, all of them continuously? I have to sub vi`s that are supposed to take in measurements from two different instruments continuously. I manage to make a program where I can open up and close the sub vi`s, but when my sub vi`s are closed, nothing is happening in them...and they start to run again when I open them...and I have to close them if my main VI is supposed to run. So the data in the chart is only from the periodes when the sub vi has been open.
    Thanks in advance for your help!

    I will send my labview programs. "Hovedprogram" is my main vi, "front" and "front 2" is my sub vi`s. I am also using global variables. I have already searched the discussion forum trying to find an answer to my problem, but I haven`t quite managed yet...
    My sub vi`s are not connected to any instrument now, but I have inserted a sinewave-generator and a chart in "front"(my sub vi) so I am able to see that the sub vi actually stop running when i close the window.
    Attachments:
    front2.vi ‏17 KB
    Hovedprogram.vi ‏42 KB
    front.vi ‏69 KB

  • Is it possible to run the Classic Environment INSIDE Rosetta on a MacBook Pro (Early 2008) with Leopard?

    Hi there,
    Rosetta works up until Snow Leopard. The Classic Environment works up until a late version of Tiger. Rosetta makes apps. built for PowerPC Macs work. The Classic Environment make apps. for Mac OS 9 work on Mac OS X for PowerPC Macs.
    Would it consequently be possible to run the Classic Environment INSIDE Rosetta?
    I have read https://discussions.apple.com/docs/DOC-2292, but I am still unconvinced unless there is a flaw to my logic. At any rate, I subscribe to the Churchillian adage of never giving in unless the forces of common sense and doctrine dictate otherwise.
    If it won't work, then why?
    Best Regards,
    Stefan

    Hi there, Klaus1, BDAqua and a brody,
    Thank you ever so much for your kind replies! (I tried giving you the 10 pts. of 'Correct Answers' to each of you, but unfortunately it was only possible for Klaus1, so the points were distributed between him and BDAqua even though you were all helpful!)
    My next question will naturally be: Is SheepShaver legal? My Google search didn't yield any conslusive proof that it was, nor any that it wasn't, but as the E-Maculation web page seemed quite official and above board I would assume that it is.
    The next logical step would be to ask whether it's safe for both HW and SW to run SheepShaver. HW, it appears, is very rarely, if ever, affected by SW settings, so I would assume that hardwarewise, I'm good to go. Could it ruin the kernel of Mac OS X's Unix-based operating system?
    Kind Regards,
    Stefan

  • How to run a jar file in a browswer?

    Hi, everyone:
    I got a problem here. I would like to run my jar file in a html-based brower, should I write another applet for my jar file? How can I do that? (I don't have applet in my jar file, but only JFrame) Is there any way I can put a runnable jar file into an applet and show on the brower? Could anyone show me how to write this code? Thank you very much!!
    -jxchou

    At first you need a java plug-in for your browser.
    Next you have to implement an applet in your jar-file.
    The tag in your html-document should look like:
    <applet code="Sample.class" archive="sample.jar" width="400" height="400"></applet>

  • How to run a jar file in JBuilder

    Hi there
    I need to know how to run a jar file using JBuilder. Thanks :)
    Countess

    well i have a german version of jbuilder and there it is under
    experten Archiv-builder
    look at something that has a similar name

  • How to run a JAR file in Unix system?

    hi there
    ca anyone tell me how to run a JAR file in unix system or X window, thank you

    You want to create an executable JAR file? You do it in the following way.
    Create a manifest file such as manif.txt and the contents should contain
    Main-Class: foo
    assuming foo is the name of your main class. Then create the jar as follows
    jar cvfm foo.jar manif.txt foo.class
    I hope that helps you!
    you can find more info here http://java.sun.com/docs/books/tutorial/jar/

Maybe you are looking for

  • ISE 1.3 Policy Set

    We want to create a policy set that hits on a endpoint identity group. An endpoint identity group contains a bunge mac-address which we can't filter out with radius user-name match which work fine for a vendor hit. Does anybody got an idea of this is

  • Cannot upload to vimeo

    since yesterday i cannot upload videos to Vimeo... when i try it, it takes like 10sec to pop up: Share Successful (which cannot be true!) ... then i log in on Vimeo and then appears: Download was a failure. ... I gotta said that the first time i try

  • Disable IE 10 & 11 Security Alert popup w/ Group Policy

    We get a Security Alert popup when accessing a https site "You are abut to view pages over a secure connection....." With previous version of IE, user can simply check box for "In the future, do not show this warning" and it will not pop up again, ho

  • Real Time Reporting in BW

    Dear All, Is Real Time Operating is possible in BW ? If it is ? Does anyone has some document or info ? If this is possible ? As far as I'm concern it is possible in SAP BW 4.0 Please advise Thanks Kumar

  • [SOLVED] A matter of fonts.

    Hello friends. I recently saw that due to legal issues we cannot get from the repositories the W7 fonts but I have a dual boot so i have access to all Macrosoft fonts just by entering into the windows partition. So my question is, can i install the f