How to create an executable JAR correct?

Hello

I have the following directory structure, it is the way in which the application is running and running Netbeans:
-TicTacToe (directory)
--board.jpg
--manifest.txt
--piece-black.png
--piece-white.png
--build (directory)
---classes (directory)
----MessagesBundle_en_GB.properties
----MessagesBundle_en_US.properties
----MessagesBundle_en.properties
----MessagesBundle_pl_PL.properties
----MessagesBundle_pl.properties
----MessagesBundle.properties
----com (directory)
-----piotrraczko (directory)
------tictactoe (directory)
-------here several class files, where TicTacToe.class should be the entry point
I need to contain all of these files into an executable JAR file. How can I do it correctly? I tried this (where manifest.txt contains the entry point information):
jar cfvm TicTacToe.jar manifest.txt board.jpg piece-black.png piece-white.png ./build/classes/
But when I then try to run the JAR file I get this error:
-bash: ./TicTacToe.jar: cannot execute binary file
Thank you
PR.

Published by: Aardenon on August 8, 2011 12:10

You must use Class.getResource () or getResourceAsStream().

Obviously if an image file is inside a jar file, it is not visible to the file system (not that is not in any directory).

The above methods responsible for the classpath, working with pots and jars exploded.

Tags: Java

Similar Questions

  • How to create an executable

    Hello, I try to figure out how to make an executable file of LabVIEW. This is my first time ever create an executable, so I need instructions to the base. I tried to do by using the project manager. The created file must LabVIEW Run-Time in order to work.

    Is it still possible to have a LabVIEW program and create an executable file that would let to any computer without products OR run the application?

    Also, I searched a few instructions on how to do it but could not find all those useful. If anyone can direct me to a post or a set of instructions that explain how to create an executable file that would be perfect. Thank you!

    Here is a link to a tutorial

    LabVIEW Application Builder application delivery

    http://zone.NI.com/DevZone/CDA/tut/p/ID/3303

  • How to create an "executable" for users to run Calc?


    I need to create an executable file that can launch users.  I want 1) open a session as long as user 'test' that I have implemented in the native repertoire, 2) app/database, select and then 3) launching a series of Calc.  I got something put in place previously in an earlier version of Essbase, but I can't seem to run on Essbase 11.

    Here's what I had previously:

    • Connection "servername" "TestUser" "Password";
    • Select "App" database;

    • RunCalc 2 ' Calc 1 ";
    • RunCalc 2 ' Calc 2. "
    • RunCalc 2 ' Calc 3. "

    Perhaps the user machines have not all the files needed to run this?  It's just flashes and doesn't give me any messages.  I'm puzzled.

    Perhaps the user machines have not all the files needed to run this?  It's just flashes and doesn't give me any messages.  I'm puzzled.

    The Essbase client has been installed on the computers of users, if not you should install it.

    The location should be something like C:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient\bin

    You will need to also use startEsscmd.cmd or evolve with the times and use startMaxl.cmd

    See you soon

    John

    http://John-Goodwin.blogspot.com/

  • How to create an executable file from a LabVIEW 8.6.1

    Hi all

    I have a VI and you want to make an executable file, let me know the steps required, thank you.

    Does anyone know how to read a manual?

  • Create the executable JAR/JAD

    I have created an application and you want one of my friend (s) to install on his BlackBerry. I want to attach the application Jad/Jar file and send it by e-mail. Please suggest the best methods to create the JAR file for hassle free installation.

    I have it. I just need to copy the files JAD and cod on the device and run the JAD that installs the application. Thanks anyway.

  • How to create the ejb - jar file. XML

    I would like to generate ejb - jar EJB 3 with Jdeveloper. I used to enter environment entries using EJB 2.0 properties. Please let me know how to do this with EJB 3 session EJB. Right click on the EJB, I cannot see the option properties.

    Thank you

    Kenny

    Hello

    Right click on your model project-> New-> General-> deployment descriptors->-> ejb Java EE deployment descriptor - jar.Xml.

    Pedja

  • Create an executable for a previous version of LabVIEW % 3F

    Title says it all.

    I have LabVIEW 2011 and my code is written using LabVIEW 2011. I know how to build an executable from my code in version 2011.

    I know how to save my code in version 2010. But I don't know how to create an executable for the 2010 version. I saw no option in

    the build process that I would create a 2010 executable. Once built, the executable must run on a computer with the runtime only 2010.

    Is this possible or do I have LabVIEW 2010 installed to create a 2010 executable?

    Just install the runtime of LV 2011 on the other PC.  A PC can have multiple versions of the Runtime installed.

  • Executable JAR using JDeveloper

    Hello

    I created a very small office with JDeveloper Application.

    What I want to do is to create an executable JAR file. I mean, is there any option in this tool such as in Eclipse. Once executable JAR is created, I must be able to run it simply by double-clicking on the JAR file.

    So can some1 please help me with the steps?

    JDeveloper: 11.1.1.6.0

    For executable jar, you will need to add:

    Main-Class: your_package.YourClass
    

    in META-INF/MANIFEST. MF file within the jar.

    I don't think JDeveloper support custom files you can modify this content after the jar is created (for example, with a tool for zip/rar/7z)

    In addition, if your application requires some extra pots, you will need to add this line to manifest:

    Class-Path: additional.jar
    

    Dario

  • How can I include all of the necessary files required for the DAQ Assistant create an executable file?

    I create an executable file to run on a computer that does not have LabVIEW.  The problem is that I am using the DAQ Assistant.  The hierarchy of the VI is big enough, and I do not know how to include all the required files to eliminate the error "the version of LabVIEw full development is necessary to correct the errors."  A picture of the hierarchy of the VI is attached.

    I think I'm missing something in the installation.  I'm downloading now the DAQmx.  I knowticed that all 7 of my missing Subvi are DAQmx * .vi

  • How to create a character bar header that is displayed correctly in all resolutions - Firefox Linux 20

    I am trying to learn how to create Personas for Firefox and already have one that I use locally, but I came across some unexpected behavior: if I create a header bar that is 3000 X 200 pixels, as specified in the guidelines, only the right third or greater displays in my browser when the theme is applied. To get this header to display 'properly' (which I find cosmetic) I have to resize the header to 1280 X 85 pixels.

    Must not the scale of the bar header automatically, or do I have to produce a header of persona to each width of possible resolution so it can display correctly?

    For what it's worth, the page footer appears at the third showing the left hand, but it's not so reprehensible in this case.

    A screenshot of the character is available at http://www2.netdoor.com/~horus/Persona_2013-04.png.

    Thanks for the ideas. I feel that I must be misunderstanding something here.

    (I tried to send troubleshooting information the first time, but it overflowed the limit of characters...)

    Persona pictures 'adapt', only as a large part of the image is displayed as you have resolution for. IOW, 1280px wide only about 1/3 of the image appears, as you discovered. This is the way in which Personas were designed to work.

  • How to create a stand-alone executable in LabVIEW 2009 Professional Development System?

    How to create a stand-alone executable in LabVIEW 2009 Professional Development System?

    This should help you http://zone.ni.com/devzone/cda/tut/p/id/3303

    Remember that the quick search with Google in many cases will be quicker to ask in this forum. I always use Google before asking for help in any forum. It is much faster

  • How to create a jar for icons

    Hi all


    How to create a jar for icons? Please help me thanks in advance.


    Sarah

    Hi Sarah!

    To do this, you use at best the jdk (java development kit) which is already
    installed on your pc in forms is installed.

    Copy all your gif icons in a folder
    Open the command prompt and in this folder.

    If we assume that you have installed forms in the default directory, call the jar.exe like this:

     x:\DevSuiteHome_1\jdk\bin\jar -cfv your_icons.jar *.gif
    

    This will create a jar file in the same directory.
    Copy the jar file into your x:\DevSuiteHome_1\forms\java folder.

    Then open your formsweb.cfg x:\DevSuiteHome_1\forms\server and change your configuration entry under the

    archive_jini=frmall_jinit.jar
    

    TO

    archive_jini=frmall_jinit.jar, your_icons.jar
    

    Please check if in your formsweb.cfg so the imagebase is set to the code base.
    If this isn't the case, create a parameter in your config entry:

    imagebase=codebase
    

    Now the jar file is loaded when you start your application and the icons are
    turns red from the jar file.

    Concerning

  • How to create executables (.exe) file

    Hello

    I have a project in labview, when I save my result is a file .vi

    I want to create an executable file (.exe) that run in a system without labviwe.

    I have 'labVIEW Professional Development System' 2011

    pleas help me to do this

    Thank you

    in my Tools menu I found 'build application (EXE) to VI... '. »

    It has solved my problem and it's really easy.

  • How to create a midi piano application equals the grand piano

    How to create a midi piano request equal to igrand piano on xcode?

    I need a source for understanding the functioning of the app...

    Thank you...

    First of all, you get a really good piano. And a very good microphone or two or three. And a studio. Record all the keys of the piano at different noise levels and settings of the pedal. Take all these records and turn them into samples. Then, write a program that plays the correct sample when the midi note and the corresponding speed is received.

  • LabVIEW FPGA: Not possible to create an executable file that uses the FPGA in Simulation Mode? I get a weird error code

    When I try to create an executable from a host VI that has an "Open FPGA VI" reference who has run, the value "Dev computer w / Sim i/o" value, the application is built without error but when I try to run it, it opens with an arrow broken to run and has the following error:

    "VI has an error of type 2302200.  The full development of LabVIEW version is necessary to correct mistakes. "In fact, he repeats this message two times in the same window for some reason any.

    Moreover, I * have the LabVIEW full development version and I use 2010 SP1

    While the error message is not as clear as it could be, you're right: you cannot run an executable file that tries to run an FPGA VI in the simulation.  It would be nice if there was an error in compiling.  I always forget to switch to run on the target FPGA before building my application and discover the error until I have it copied on the system in the laboratory.

Maybe you are looking for