Create the executable jar's file

Hi guys,
I am working on java desktop's application where a user will be able to run the application by double click the executable jar file. I followed the description of "Creating and Deploying a Simple Archive to Your File System of the help. After creating the jar file and when I double click on jar file to run the application I got this error message "Could not find the main class. Program will exit". I was not also able to run the application on the dos command.
Please help. I don't have any problem when I run from Jdeveloper 9.0.4. I have window XP professional.
Your input will be very welcomed.

OK open up your deployed Jar file in something like Winzip and have a look at the Manifest.MF in meta-inf\
I've just created an executable JAR with a main class of mypackage1.Class1 and it all ran ok. Here's the manifest:
Manifest-Version: 1.0
Main-Class: mypackage1.Class1
Created-By: Oracle9i JDeveloper 9.0.2So make sure your's is similar and your Main-class looks the same - e.g. does not say something like:
Main-Class: mypackage1.Class1.class

Similar Messages

  • Unable to create an executable jar file

    Hi,
    I am unable to create an executable jar file,
    I am using the command as follows:
    C\> jar cvfm MyJarName.jar manifest.txt Demo.class
    where as Demo.class has appropriate main method; manifest.txt contains [ Main-Class: Demo ] and a new line
    Please help.
    thanks & regards
    M K Rayapudi
    Edited by: R6i on Apr 30, 2009 5:15 AM

    Your jar is perfectly generated, but your machine has a problem with .jar file associations.
    You have two options:
    1. Play with the registry. Dangereous if you are not used to.
    2. Reinstall the jre.
    Just to verify my theory, open a command prompt and the command:
    reg query HKCR\jarfile\shell\open\command
    What does it say? I have executed your command , here is the output
    HKEY_CLASSES_ROOT\jarfile\shell\open\command
        (Default)    REG_SZ    "C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*I am not getting anything from this command, can you please explain clearly.
    thanks & regards
    M K Rayapudi
    Edited by: R6i on May 3, 2009 10:18 PM

  • Create the missing server.xml files yourself

    Paula and I created the missing server.xml files ourselves. The script is at the bottom of the post.
    We badly needed the missing server.xml files to work on the customizations and Oracle was unable to solve this problem.
    "I checked on our Automated Release Updates System found that we dont have server.xml that includes PosDelivSchedVO. This confirms that there is no patch available at present to provide you with this file.
    As this is not related to coding issue,Support will not be able to log a bug with Development. You may log an Enhancement Request via Metalink, so that Development would review your requirement and if feasible would include this file at the time of future releases"
    #!/bin/sh
    # This script is used to generate the missing server.xml files for $JAVA_TOP/oracle/apps/pos
    # Usage: server.sh
    # Note: This script has many hardcoded codes and it may generate the wrong server.xml.
    # The manual fixes to the generated server.xml may be need.
    # Check the codes before you use it.
    # It's possible to write a generic version of this script to deal with more issues, like
    # 1. dealing with the Oracle apps patches applied
    # 2. only generates the missing server.xml files automatically
    # 3. can specify the module, like pos or po ..., to generate server.xml.
    # 4. including only the OA Framework objects used.
    # 5. correctly generate the right "encoding"
    # Luke Chi
    APP=pos
    PKG_HEAD=oracle.apps.$APP
    PKG_TAIL=server
    SERVER_FILENAME=server_1.xml
    cd $JAVA_TOP/oracle/apps/$APP
    # for SUB_DIR in asn isp lov product rcv sbd ship administration changeorder jar planning profile registration schema servic
    es suppreg
    for SUB_DIR in asn lov product rcv ship administration planning profile schema services suppreg
    do
    echo $SUB_DIR
    cd $SUB_DIR/server
    PKG=$PKG_HEAD.$SUB_DIR.$PKG_TAIL
    cat << EOF > $SERVER_FILENAME
    <?xml version="1.0" encoding='WINDOWS-1252'?>
    <!DOCTYPE JboPackage SYSTEM "jbo_03_01.dtd">
    <!-- \$Header: server.xml 115.11 2003/03/25 22:31:14 luke ship $ -->
    <JboPackage
    Name="server"
    SeparateXMLFiles="true"
    EOF
    echo " PackageName=\"$PKG\" >" >> $SERVER_FILENAME
    ls *.xml | grep -v server*.xml | while read FILE
    do
    BASENAME=`basename $FILE .xml`
    cat << EOF >> $SERVER_FILENAME
    <Containee
    Name="$BASENAME"
    FullName="$PKG.$BASENAME"
    EOF
    for TYPE in AM EO VL VO AO
    do
    BASENAME_2=`basename $BASENAME $TYPE`
    if [ $BASENAME_2 != $BASENAME ]; then
    case $TYPE in
    AM) echo " ObjectType=\"AppModule\" >" >> $SERVER_FILENAME ;;
    EO) echo " ObjectType=\"Entity\" >" >> $SERVER_FILENAME ;;
    VL) echo " ObjectType=\"ViewLink\" >" >> $SERVER_FILENAME ;;
    VO) echo " ObjectType=\"ViewObject\" >" >> $SERVER_FILENAME ;;
    AO) echo " ObjectType=\"Association\" >" >> $SERVER_FILENAME ;;
    CO) echo " ObjectType=\"Luke_CO\" >" >> $SERVER_FILENAME ;;
    *) echo " ObjectType=\"Luke_UNKNOWN\" >" >> $SERVER_FILENAME ;;
    esac
    break
    fi
    done
    echo " </Containee>" >> $SERVER_FILENAME
    done
    echo "</JboPackage>" >> $SERVER_FILENAME
    grep Luke $SERVER_FILENAME
    if [ $? -eq 0 ]; then
    mv $SERVER_FILENAME server_error.xml
    fi
    pwd
    cd ../..
    done

    We loaded the Oracle seeded BC4J components from mid-tier file system to jdev OA Framework using the server.xml files generated by our Unix script attached in the privious posting above. We ,then did the customizations and successfully deployed them to our test Oracle apps.

  • Create the original prov.xml file for Provisioning Toolkit Enterprise?

    How do you create the original prov.xml file to be used with Provisioning Toolkit Enterprise? This is for use to resovle the issue with Creative Cloud Enterprise deployments serialization breaking during imaging. Several people indicated to try and reserialize with PTE. 

    Hi msdavidson,
    Please follow this KB article for Adobe Provisioning Toolkit.
    http://helpx.adobe.com/creative-cloud/packager/provisioning-toolkit-enterprise.html
    Hope it answers your query.
    Regards,
    Abhijit

  • How do I access my encrypted User Account files from my Back Up hard drive?  Time Machine  was used to create the back up disk; File Vault was used to encrypt the files.

    How do I access my encrypted User Account files from my Back Up hard drive?  Time Machine  was used to create the back up disk; File Vault was used to encrypt the files.

    Thanks.  I will try going through TM.  Since my Simpletech is on the way out, I'll be plugging in a new external hard drive (other than the back-up drive) and trying to restore the library to the new drive.  Any advice or warning if this is NOT the right thing to do?
    Meanwhile, that is a great tip to do an alternate back-up using a different means.  It's been tough to figure out how to "preserve access" to digital images and files for posterity, knowing the hardware will always fail/obsolesce sooner or later, and that "clouds" are only as good as their consistent and reliable accessibility.  Upping the odds with redundancy will help dull the edge of my "access anxiety", though logically, it can never relieve it.  Will look into
    Carbon Copy Cloner.

  • Creating an Executable jar file

    Hello ! I have a application that has been fully developed and all i want to do is to create an executable file using my own icon so that whenever it is double clicked it opens up the appliation.
    Please provide an example fro easy refrence.
    Thanks

    i have the procedure for creating executable jar file in a separate file.
    if u r interested then mail me at:
    [email protected]
    regards
    Md. Afroze

  • Creating an executable jar-file including a custom package

    I am trying to learn how to create executable jar-files. I have managed this with a single class. However having a class which is an extention of another class which in turn belongs to custom package, I can't make it work.Running the program normally is not a problem. I don't think the problem is the actual code, but I will include it here anyway. I create the jar-file using:
    jar -cmf Direkt2b.txt Direkt2b.jar *.class
    where Direkt2b.txt is just:
    Main-Class: Diriekt2b
    Only the main class-file is included this way. Copying the other file to the same directory before creation doesn't help either. There is no error messages, the jar-file just refuses to run no matter what.
    The main-class:
    import java.awt.*;
    import extra.*;
    class Direkt2b extends ExtendedFrame {
         Font f;
         Direkt2b() {
              f = new Font("SansSerif", Font.BOLD, 24);
              setBackground(Color.yellow);
              setSize(400,150);
         public void paint(Graphics g) {
              g.setFont(f);
              g.setColor(Color.blue);
              g.drawString("V?lkommen till Java Direkt", 45, 100);
         public static void main (String[] arg) {
              Direkt2b d2 = new Direkt2b();
              d2.setVisible(true);
    The help-class:
    package extra;
    import java.awt.*;
    import java.awt.event.*;
    public class ExtendedFrame extends Frame {
         private static boolean first = true;
         private boolean isFirst = first;
         public ExtendedFrame() {
              addWindowListener(theListener);
              first=false;
         WindowAdapter theListener = new WindowAdapter () {
              public void windowClosing(WindowEvent e) {
              dispose();
              if (isFirst)
                   System.exit(0);
    }

    My problem wasn't really getting more than one class in a jar-file,
    but rather that my jar-file with multiple classes wouldn't execute.
    Reading the original post I realized that maybe I was unclear about that.
    However I have solved the problem now so for anybody reading this
    thread in the future I will tell you how.
    The general setting is this: You have a bunch of self-made help-classes
    organized in some classdirectory somewhere in the filesystem. You use these
    in your programming from time to time. You have set a classpath-varible
    in your OS such that Java could find your help-classes.
    Now you want to create executable jar-files so that you could publish your work.
    My problem was that while I added all needed classes in a jar-file, the main-class
    couldn't find the others because they were referenced incorrectly. The solution I
    came up with may not be elegant, but it works. I copied the main-class and all directories
    (only one in my case) just as they appear in the classpath-directory, to the same temporary
    directory. Then I created the jar-file from there, using: jar -cmfv Direkt2b.txt Direkt2b.jar Direkt2b.class extra/*.class
    I suspected that incorrect referencing was the problem and I tried several variations on the theme above
    before giving up and writing the first post. Part the problem was that I didn't get any error messages,
    just an annoying error-sound double-clicking the jar-file. I learned later that you could run jar-files from
    the command -prompt using: java -jar myjarfile.jar. This way you get a more useful response.
    I guess there is a way to include the classpath instead somehow, but I will use my method for now.
    I hope this was helpful to somebody.

  • Large project in JBuilder 2007... How do I create an executable JAR?

    First, I've googled quite a bit and keep getting thiings about "Jbuilder Application Wizard", etc... Well, I don't see any "wizard" menu in the version of JBuilder I'm using!
    I'm using JBuilder 2007 Enterprise edition, however it's a trial version apparently. I'm not sure if that matters, and perhaps the functionality was taken out with the trial version..
    Anyway, the issue is that I have a multi class (with one main function) program that I want to run (it's a command line based application) as an executable JAR file. The program uses LOTS of include statements including quite a few custom libraries ("external JARs") that I had to import.
    Basically I want the application to do exactly what it does now when I hit the ol' "RUN" button. Except I want to be able to run it from a batch file with "java -jar (or whatever) myProgram".
    Anybody have any experience with this type of thing?

    OK, here's what I've got:
    I've got a jar file that contains:
    1. a folder "importQD"
    2. a folder called META-INF
    3. a .classpath file
    4. a .project file
    Inside the importQD folder are my three .class files that are the classes I created myself.
    Inside the META-INF folder is the MANIFEST.MF file which looks like:
    Manifest-Version: 1.0
    Main-Class: importQD.ImportQDInside the .classpath file we have:
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
         <classpathentry kind="src" path=""/>
         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
         <classpathentry kind="lib" path="C:\Programs\CMQualityDocumentImport\CMUploadInterface83.jar"/>
         <classpathentry kind="lib" path="C:\Programs\CMQualityDocumentImport\DBCon.jar"/>
         <classpathentry kind="lib" path="C:\Programs\CMQualityDocumentImport\SENAeMail.jar"/>
         <classpathentry kind="lib" path="C:\Programs\CMQualityDocumentImport\SENAFileHandler.jar"/>
         <classpathentry kind="output" path=""/>
    </classpath>NOTE: All of the paths point at the .jar files as they are located on the machine the final version will be running on.
    Inside the .project file we have:
    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
         <name>importOldQD</name>
         <comment></comment>
         <projects>
         </projects>
         <buildSpec>
              <buildCommand>
                   <name>org.eclipse.jdt.core.javabuilder</name>
                   <arguments>
                   </arguments>
              </buildCommand>
         </buildSpec>
         <natures>
              <nature>org.eclipse.jdt.core.javanature</nature>
         </natures>
    </projectDescription>Now, it would make sense to me that this should be all good to go, and that I should be able to run this via a command line now. When I try
    java -jar importQD.jar I get a ton of various errors such as "Exception in thread "main" java.lang.UnsupportedClassVersionError: importQD/importQD (unsupported major.minor version 49.0) + a nice stack trace with a bunch of java.lang and java.net references.
    What am I doing wrong?

  • How do i create an executable jar?

    I have built a GUI, and want to make it executable. I have tried compiling it to a jar, but when i double click this nothing happens. I even added Main-Class to the manifest file but still no luck.
    any help would be appreciated, or a link to a good tutorial. I have already tried the sun tutorial, but it still doesnt work.
    Thanks
    Ben

    I got it working :D
    jar -cfm TestJar.jar manifest.txt GUI.class GUI$1.class ./org/gui/*.class ./info/clearthought/layout/*.class
    java -jar TestJar.jar
    This created the .jar. I will experiment with Class-Name: later, atleast i have something to show now.
    Thanks to everyone for their help on this matter
    Ben
    edit:
    just changed the manifest file to include,
    Class-Path: JCalendar4.jar TableLayout.jar
    Worked a dream..... thanks everyone i think i have a pretty good grasp on how to create jars now. Just need to learn now how to create jnlp files :D
    Message was edited by:
    CyborgAvenger

  • Creating an executable JAR

    edited mainfest file by create a text file MainClass.MF and added this in
    Manifest-Version: 1.0
    Main-Class: test_gui
    left two carriage returns and saved file as MainClass.MF included three other classes I required into MailMerge.jar in command line as follows
    jar cmf MainClass.MF MailMerge.jar classone.class classtwo.class classthree.class test_gui.class
    tried executing application by double clicking but failed, tried executing application through the comand line as follows
    java -jar MailMerge.jar, and got following error. There is a main method in test_gui, tried running application normally by running java test_gui and it worked successfully, what have I done wrong with my jar!!!
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException
    at test_gui.<init>(test_gui.java:25)
    at test_gui.main(test_gui.java:138)

    The value given to Class-Path should be a plain list of file names with whitespace as separator. Also, the list should be portable so it should only contain relative paths -- unix computers don't have a C: drive, and what if someone puts the library files somewhere else than your hardcoded place.
    The Class-Path line should look like "Class-Path: activation.jar mail.jar" and those .jars should be in the same directory with your MailMerge.jar.
    Exception in thread "main" java.lang.NoClassDefFoundError: test_guiThe class test_gui is not in the .jar file. You probably used "jar -cmf" and forgot that the "c" creates a new .jar file, overwriting the existing one. You should have used "u" to update.

  • I'm having problems with a message that says: An error occurred while Attempting to create the directory: C:/program files/itunes/cd configuarion

    I know this is a long story, but I'll be damned if I'm not going to get the most specific help I can (as Apple seems to specialize in assuming user error for all its demonic software). I've never had issues with iTunes before (barring a "Connect to iTunes" snafu with my iPod Touch) -- and never, in fact, with Windows Vista, if you believe that -- but this is the most bizarre thing I've seen.
    I recently downloaded the new iTunes v 9.0.3 as I am occasionally prompted to do whenever a new version comes out, and immediately I had problems. Access to the iTunes and Quicktime folders was mysteriously denied after the update, and after several hours of frustration, I was able to grant my own Administrative access to these two folders and installation went through. Thank God.
    Then I bought some music. No problems -- downloaded just fine, along with a copy of Cinderella Man and the new episode of Smallville. Life was good for a few days.
    Then I connected my iPod Touch to the computer. All of a sudden, Microsoft Windows informs me that the "Apple Mobile Device Service stopped working and was closed," with subtext, "A problem caused the application to stop working correctly. Windows will notify you if a solution is available."
    Bullsh*t Windows can help me with anything from Apple.
    So I've tried to get iTunes to work with me on this. I've come up against the infamous "iTunes could not connect to this iPhone because an unknown error occurred (OxE8000001)" message. My God, when does it ever end?
    So I go into Control Panel > Administrative Tools > Services > Apple Mobile Device and start it back up... only to watch it stop again inexplicably moments later. Hmm... Restart. Stays on. Unplug the iPod and plug it back in. Apple Mobile Device Service stops again. Maybe it's the iPod Service itself. Hey, that one's not started! [Start] "Windows could not start the iPod Service service on Local Computer -- Error 5: Access is denied."
    What the f*ck is it with this "Access denied" crap? I've never been denied access to even the most intimate functions, files and folders on my freaking computer before! What has Apple created!?
    I thought, perhaps Apple Mobile Device software was somehow removed. Okay, let's redownload iTunes (aka Repair the program from the Programs and Features menu in the Control Panel -- same thing). Huh. "An error occurred while attempting to create directory C:\Program Files\iTunes\CD Configuration," and I can choose to Retry or Cancel. So, instinctively, I deleted the CD Configuration folder, assuming iTunes Setup would just recreate it.
    Well, that didn't work now, did it? I deleted it and hit Retry, and it said, "The installer has insufficient priveleges to access the directory: C:\Program Files\iTunes\CD Configuration. Log on as administrator or contact your system administrator." Running the .exe file as an adminstrator changes NOTHING about this predicament.
    So that's where it stands. No CD Configuration folder; full access to all files and folders involved; Apple Mobile Device Service still keeps going off for no reason; iPod Service still doesn't run; Repairing/Reinstalling iTunes, Quicktime, Bonjour, etc. does nothing; and God (aka Steve Jobs, apparently) hates me.
    . . . . . . . . . . . . Help me.

    Hi there,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/ht1926
    -Griff W.

  • How does firefox create the default mimetypes.rdf file?

    Hi, I am trying to update the default mimetypes.rdf file to add a list of new file types and the associated program to launch with but am struggling to find where/how the default mimetypes.rdf file is created.
    The Omni.ja file within 'C:\Program Files\Mozilla Firefox' has a version of the file but it is blank, what populates this file?
    I have tried replacing this file with the version we need to use, delete the Mozilla directory from my local profile and re-launch Firefox, but the newly generated mimetypes.rdf file is still the old version.
    I am using Firefox version 10.0.6

    Hi,
    I am in the same situation than you but I forced firefox to take my own file if I remove it from my profile.
    What i did:
    1 Create my own custom mimetypes.rdf file. Firefox Interface - Options - Options - Applications...
    2 Copy mimetypes.rdf in C:\Program Files (x86)\Mozilla Firefox\browser\Defaults\profile
    So, if I remove the mimetypes.rdf file from my profile it takes from default location fine. However deleting the profile, opening firefox again it doesn´t use my own mymtypes.rdf file in the new profile, insteant it creates the "default installation" one.
    On the other hand, I tried to set pdfjs.disabled = true from about:config, however although it sets the default PDF app "Adobe Acrobat", it doesn´t work. It doesn´t open any pdf file.
    I am thinking to create an advertised shortcut in order to replace the mimetype.rdf when the user starts firefox (I distribute the firefox settings in a MSI) depending of the date of the file but it will take a few seconds each time the user run firefox. I really don´t like it...
    Sorry for don´t help too much...
    If anyone could post how firefox create mimetypes.rdf in new profiles...

  • How do I create an executable JAR File ?

    Hi,
    Let's say I have several Class Files that perform a special task.
    How do I bundle them in a JAR file and make it executable, so that the user simply types "prog.jar" and is happy.
    I wonder how that works, as I have to tell the starting point for execution.
    Does anybody now ?
    cu
    Oliver

    Three importants things to do :
    - don't forget to indicate in your manifest.mf the main class and the pacckage
    ex:
    Manifest-Version: 1.0
    Main-Class: mypackage.MyMainClass
    Created-By: 1.3.0 (Sun Microsystems Inc.)
    - don't forget to associate the .jar file with the application java.exe -jar -classpath %CLASSPATH%
    - don't forget to set the environment CLASSPATH correctly
    Hope this help
    Jean

  • Updating an XML file inside the executable JAR.

    Hello all!
    I would like to askk how can i update an XML file that is packaged inside my jar file?
    For intstance:
    I have a Java Application in NetBeans
    Inside a package i have constructed a custom .xml file.
    I can read from this file using
    .....getClass().getResourceAsStream("/.../file.xml")and after that using XPath for querying and works fine.
    I want to update an entry in my xml file so the jar contains now the newly updated file.
    Thanks everyone who spends hit time to read this. Hope someone can help me.

    Please don't cross-post:
    http://forums.sun.com/thread.jspa?threadID=5342194

  • Create the database from Binary files

    Hi
    Can anyone assist is possoble to build a database with binary files.
    I lost all the database files in the standby server, im not having installation files. Can I build the database by copying the binary files from different sever? if possible please provide me the steps.
    Database Version : 8.1.7.4.0
    OS Version : Sun OS 5.8
    Venkat
    Edited by: R VENKAT on Nov 4, 2008 4:15 PM

    Hi Venkat,
    I think this isn't the best forum to answer your question but I'll try.
    You've lost your DATABASE FILES (means DBF files, control files (CTL), redo logs)? Correct?
    Or did you loose also the Oracle Home where the software has been installed?
    If you've lost your Oracle installation than you might do the following:
    1) Install 8.1.7.0 software on your standby server
    2) Install patch set 8.1.7 4 into this home
    3) Metalink-Note:70233.1 will describe the full process of creating an 8i standby database from your PROD.
    If you use RMAN than please have a look into Metalink-Note:203980.1 and Note:118409.1 - it'll describe also the init.ora parameters necessary for a standby
    You'll find a description of an ideal init.ora for the standby in ML Note:139809.1 and specific for Data Guard 8i here: ML-Note:132991.1
    Kind regards
    Mike

Maybe you are looking for

  • Can iTunes on Windows partition use same library as Mac partition?

    Now that the Windows partition on my Mac Pro can recognize the Mac formatted drives in my system, can I use the same iTunes library on Windows that I use on Snow Leopard? I tried changing the path in the advanced tab of the preferences window, but th

  • Display: White on black without inverted pictures?

    I have changed my display to white on black as I find it a lot easier to read webpages and word documents. Only all of the pictures are inverted too. I only want the background and text inverted without it affecting pictures on the web, my wallpaper

  • Unsupported PDE in Print Dialogue box 10.8.5

    Am receiving an error message 'Unsupported PDE' in print dialogue box (full message "The bundle "EF283976 (FF)" couldn't be loaded because it is damaged or missing necessary resources). This is for print driver Canon iR-ADV C7000s-A1 PS V1.0 Have rei

  • Actions extension folder not appearing

    So last week I downloaded the latest and greatest OSX 10.10... But I found an issue, and I'm not sure if I'm the only one, but in the extensions there isn't an "Actions" folder with plugins. I originally found out because I couldn't figure out how to

  • LMS 4.1 - Fault Notification Group

    I've populated my LMS v4.1 device database with all our managed devices (192.168.x.x).  When I go to 'FAULT NOTIFICATION GROUP' and I must select either the nodes or groups that are associated with this this group, certain nodes are not appearing in