Help -- Trying to create JAR file but not working

Hi everyone
I have created a rather noddy Java program that consists of 4 JComboBox's and 1 JButton on a JFrame.
When the button is clicked a text file is generate with the options that have been selected.
There are severial files that the program uses for this:
gcc.java
OutToFile.java
gccConfirm.java
MyNewWindow.java
main.java
I am using Jcreator and so must use the command line to create the Jar file.
I have never done a jar file before so I did an example with a hello world program and got it working now problem. I did the same for this program and the JAR file is generated without error. I double click on the JAR file to run the application, but nothing happens. I can see the application running in memory but nothing loads on the screen. However if I run it from the command line using Java -jar gcc.jar then everything is ok.
can anyone help me here?
thanks in advance

If you run you .jar from the command line (a shell in unix speak) there
already is a console where your java program can send it's System.out
stuff. Right click on your .jar and select 'properties' (or similar). Note
that your .jar is run by 'javaw'. This executable is similar to the 'java'
executable except that it doesn't open a console for you. Change the
'javaw' command to 'java' and voila, there's your console again.
kind regards,
Jos

Similar Messages

  • HT201210 trying to download an instal ios 7 on my iphone 4s, after half an hour into the download it came up with a message saying failed and everytime i try again the download doesnt start. tried downloading from itunes aswel but not working. anyone know

    trying to download an instal ios 7 on my iphone 4s, after half an hour into the download it came up with a message saying failed and everytime i try again the download doesnt start. tried downloading from itunes aswel but not working. anyone know why?

    The servers are overloaded. There are a hundred million people all trying to download iOS 7 at one time. Try again later

  • .jar file suddenly not working

    I have some minimal experience working with .jar files, but I am baffled here.
    Recently, the jar file for one of my programs stopped working. I had just made a change to my main class, so i repackaged the jar. Now it says "Can't find main class" when I try to run it. It will only work if I add the line
    Class-Path: . (there is a period there)
    to my manifest.
    This would be fine, but I want to use exe4j to make it into a Windows executable. exe4j must do something where it does not honor the mainifest settings, because the executable gives out a "can't find main class" error no matter what.
    What has happened? It is only an issue with this program, i have repackaged several others to test, and they work without the "Class-Path" workaround. I'm pretty sure that it's not something in the nature of the program itself, because it worked eariler, and my only change was a small one (the text of a few JLabels).
    I have made sure that my main class is in the root of my jar file, and I have the Main-Class attribute correctly set in my manifest. The program runs fine outside the jar, but displays this odd behavior only when "jarred".
    Any help would be greatly appreciated.

    also, it's only the one class that's affected.
    I tried setting the Main-Class to other classes in the jar, and that worked fine. When I tried to make a workaround, making one of the other classes' main call the one I wanted, i got a "fatal exception" error. I'm pretty sure it still couldn't find the file.

  • .jar file is not working properly :developed in NETBEANS

    Hi Gurus,
    i am using NETBEANS IDE 7.2.
    i am developing a project that interacts with databases 10g and COM ports of machine , these all processes are performed by .bat file which i am trying to run from jFramform , code works perfectly .bat file is also called perfectly when i run the project using F6 from the NETBEANS, for testing i placed some dialogue boxes on the form to test it ,
    but when i run executable .jar  file , form run successfully and dialogue box works perfectly but .bat file is not called by executable .jar file.
    this is how i call the .bat file...
      String filePath = "D:/pms/Libraries/portlib.bat";  
            try { 
              Process p = Runtime.getRuntime().exec(filePath); 
            } catch (Exception e) { 
                e.printStackTrace(); 
    and below is the contents of portlib.bat file
    java -jar "D:\SMS\SMS\dist\SMS.jar" 
    you must probably ask why i am calling a .jar file using .bat file .
    reason is that this .jar project sends message using GSM mobile , System.exit(); is compulsory to complete a job and then do the next one ,
    if i use the same file to execute this job it makes exit to entire the application (hope you can understand my logic).
    that's why i use extra .jar file in .bat file , when single job is completed .bat exits itself and new command is given.
    Problem is that code is working perfectly in NETBEANS when i run the project but when i run .jar then .bat file is not working  ,
    thanks.

    Thanks Sir ,
    You need to first test an example that works like the one in the article.
    There are plenty of other examples on the web - find one you like:
    http://javapapers.com/core-java/os-processes-using-java-processbuilder/
    I tried this one.
      try {
                ProcessBuilder dirProcess = new ProcessBuilder("D:/SMS/SMS/Send_message.bat");
                 File commands = new File("D:/SMS/SMS/Send_message.bat");
                 File dirOut = new File("C:/process/out.txt");
                 File dirErr = new File("C:/process/err.txt");
               dirProcess.redirectInput(commands);
                 dirProcess.redirectOutput(dirOut);
               dirProcess.redirectError(dirErr);
                 dirProcess.start();
            } catch (IOException ex) {
                Logger.getLogger(mainform.class.getName()).log(Level.SEVERE, null, ex);
    as instructed in the article i compiled  both the projects at same version or sources and libraries which is 1.7
    here is my version details
    C:\>javac -version
    javac 1.7.0_07
    C:\>java -version
    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
    Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
    inside the NETBEANS IDE c:\process\err.txt  remains empty and code works perfectly , but when I run executable .jar file( by double clicking on that file in dist directry) then c:\process\err.txt becomes full with this error text and there is no response from calling D:\SMS\SMS\send_message.bat
    here is the error text
    java.lang.UnsupportedClassVersionError: sms/SMSMAIN (Unsupported major.minor version 51.0)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Exception in thread "main"
    here is /SMS/SMS
    unknown source ?

  • Jar file is not working

    Hi,
    I have an Applet packed in a JAR file. It works very well in my local site, but when I upload it to internet it throws a java.lang.ClassNotFoundException: nibbly
    Of course I've checked names, cases, files are in the same directory.
    The html code is very simple:
    <APPLET ARCHIVE="nibbly.jar" CODE="nibbly.class"
    WIDTH=402 HEIGHT=350>
    </APPLET>
    Any help or advice would be appreciated.
    Thank you

    you can see the error in
    www.magnino.terra.cl/arch/nibbly.html
    I will check the "binary mode" of my FTP
    the nibbly.jar is in the same directory of the nibbly.html page
    thank you
    Luis

  • Jar file is not working after deleting all packages from the same directory

    hello
    i have created a jar file named as server.jar in the same directory in which i have all the packages(for which i have created this jar file).This jar file was working correctly when i had all the packages in the same directory.But after deleting all the packages from the same working directory, this jar file is neither working nor giving any error message..
    Please tell me what may be the reason???
    thanks in advanced

    hello
    i have created a jar file named as server.jar in the same directory in which i have all the packages(for which i have created this jar file).This jar file was working correctly when i had all the packages in the same directory.But after deleting all the packages from the same working directory, this jar file is neither working nor giving any error message..
    Please tell me what may be the reason???
    thanks in advanced

  • Some prolems when trying to create Jar file...

    Hi,
    1st sorry i post this in the wrong box, i posted it in the Jar box but no body replied and I really need to get this done soon...
    I've got a list of *.class and a folder images and Start is the class I want to be the entry point
    I tried:
    1. jar cfm MyApp.jar Manifest.txt *.class images
    In Manifest.txt has a line: Main-Class: Start
    the jar file is created, but when I tried to run (both double click and command line) this gives me an error "Failed to load Main-Class manifest attribute from..."
    2. jar cmf MyApp.jar Manifest.txt *.class images
    this has error while making the jar file, it gives "java.io.FileNotFoundException: MyApp.jar (The system cannot find the file specified)...
    3. I tried the 1st method, then unzip the jar file, edit the manifest.mf file by adding a line Main-Class: Start. Then zip it, rename it to MyApp.jar
    And a weird thing happens... When I place the jar file IN THE SAME FOLDER with other class files, it runs fine. But when I move it to A DIFFERENT FOLDER with other class files, it runs with dimension 0x0, i.e. only the title bar is displayed...
    I've tried those method and none of them work... can some one tell me what I have done wrong?
    Thanks...

    This is the class used to get the ImageIcon for the JLabel
    public class CardGUI extends JPanel {
         private ImageIcon tmp;
         private final int CARDWIDTH = 50; //Card width is 50
         //return the Card GUI
         public ImageIcon getCardGUI (int kind, char suit) {
              //This String is used to locate the file (*.png)
              //of each Card
              //E.g. Card 2 Club will has file "images/cards/2c.png"
              String imgStr = "images/cards/" + kind + suit + ".png";
              tmp = new ImageIcon(imgStr);
              //If the card is not found, return the back of the Card
              if (tmp.getIconWidth()!= CARDWIDTH) {
                   tmp = new ImageIcon("images/cards/back.png");
              return tmp;
    }Then the JLabel used this to set the image, where humanCard1 is an instance of JLabel, and cardLabel is instance of the above class.
    humanCard1.setIcon(cardLabel.getCardGUI(card10.getKind(), card10.getSuit()));
    > new ImageIcon("images/mainbackground.jpg")Wrong. Because there are any more no files in a jar archive. Only file is the jar file itself, and nothing else.
    What do u mean? When I create the jar file, i include the images folder inside the jar file already?
    I've been using the Swing forum and that's how I know the 2 methods above for setting image for JLabel and JPanel... So what should i be searching for in the Swing forum now?

  • ODS, Inventory cube, and WM- Trying to run a report but not working! Help

    Hi Gurus,
    Hope somebody can help me here....
    I have an Inventory Cube and an ODS on Material Plant and another on Warehouse Management. For my reports I need fields from three of them so I created a Multi Provider by using these. But I have only Material and Plant as common in three of them, which is used in defining the Multi Provider. Along with these I have used some more characteristics which are not common. So now when I run a query on this MP, I am getting a display wherein the common characteristics get the values that are correct but for uncommon chars the values for the kfs from other data targets become blank and an additional row comes too.
    For example, I have kfs like Blocked stock in the cube and in one of the ODS I have kfs like standard price. So, in the query for the char material group which comes from the ODS there are no values for Blocked stock, I mean I can see a row wherein there is a value for Blocked stock and a blank for Standard Price,  in the additional row there is a blank for Blocked stock and a value for Standard price. This is the case with all the other kfs of different info providers.
    Is it because they are not common in all the info providers? Is there anyway to solve this? RRI will not work as I need the KFs from both the info providers.
    I am stuck now with this problem, so any guidence would be a BIG help.
    Thanks

    Is it because they are not common in all the info providers?
    -->Yes
    Is there anyway to solve this?
    --> Yes and no. If there is a join condition between the ODSs that you can use to get the fields on the same row, you can do an infoset.
    --> To achieve something like an outer join, you can create RKF for your base KFs, and restrict them on uncommon chars with 'constant selection'. This may not work in all cases. Search for a blog by Prakash Darzi on 'Constant selection' to understand this.
    If logically there doesn't exist a relation (try to visualise how you will derive your output row if you were given these two in a file or spreadsheet - is there a logical link to connect the two sets of data?) you cannot expect the results that you look for.

  • Trying to create custom theme but not able to find it.

    Hi,
    I am using Oracle 10g Database Express and APEX 4.0 and am trying to create a custom theme based on an existing one.
    I have created a theme_100 folder in the filesystem as a copy of theme_8 and have edited the css file & changed the colours of the images using Infraview graphics editor.
    I then have uploaded them into the DB using the WebDav function and can see the files when I run http://localhost:8080/i/themes/theme_100/
    However, within the application builder when I create an application and choose a theme, mine is not showing.
    Can you help me with whatever steps I am missing?
    Regards
    Adrian

    The templates used by your new theme in apex(that you created when you copied) would still be referencing your old css path.
    So update check the templates used in your new theme for the referred css files
    <li>In Your new theme's page templates check for the directory path that point to the old theme and modify that
    For example(I am using theme2 here)
      <link rel="stylesheet" href="#IMAGE_PREFIX#themes/theme_2/css/theme_4_0.css" type="text/css" />
      <!--[if IE]><link rel="stylesheet" href="#IMAGE_PREFIX#themes/theme_2/css/theme_4_0_ie.css" type="text/css" /><![endif]-->
      <!--[if IE 6]><link rel="stylesheet" href="#IMAGE_PREFIX#themes/theme_2/css/theme_4_0_ie6.css" type="text/css" /><![endif]-->
      <!--[if IE 7]><link rel="stylesheet" href="#IMAGE_PREFIX#themes/theme_2/css/theme_4_0_ie7.css" type="text/css" /><![endif]-->Change the string in the CSS file path from theme_2 to theme_10 , assuming that it is in the same directory as the other themes. Else modify it appropriately.
    Do this for all page templates(or atleast the ones you use).

  • My JAR file is not working properly!!!

    Hi everyone,
    I made an application that has a GUI (window). I converted it into a JAR file so I can send it to a friend by email. Then she can run it to generate the output. First, the user has to select a destination to save the .txt file (using JFileChooser). Then enters the inputs (using JTextFields). Clicks "Run" button (Results will be calculated and copied to the file). A Message will appear indicating that the results are copied. The problem is that when I run the application in the IDE (Eclipse) it works fine. But when I convert it into JAR, The moment I click the "Run" button, suddenly the window closes. Please HELP???
    Thank you

    DrClap wrote:
    Eng.Sh_2004 wrote:
    Sorry guys, but i would like to make things clearer, As I mentioned earlier, What i'm doing is the following: 1) Using the Jfilechooser, save the results into a filename.txt file _[main class in the manifest file (class for the GUI) ]._ 2) Click "run" to write the data to the created file in step 1 [_another class is used to write to file_]. I have a feeling that the problem is related to the manifest main class. What do you think guys?I think your description of the problem is very bad. And I think your idea of making wild guesses is a bad way of diagnosing problems.
    First of all. A JFileChooser does not save anything. It just allows the user to select a file to be saved to. So if you thought that the first step was writing anything or creating any file, you're probably wrong. But examining the code would help you understand.
    Second, if you're having problems because one class chooses the file name and a second class writes data to it, then you're probably running into the basic beginner problem we see around here all the time of how to communicate data between objects. Again, examining the code might help.
    Third, you need to understand what is writing that error message. Examining the code would help there too.
    So: stop guessing. Look at the code.I'm still New To Java that's why i find difficulty in problems diagnosis. Regarding the JAR problem, as you mentioned, I used JFileChooser to select a file and (copying data) is the other part. So I will look at the code again.
    Edited by: Eng.Sh_2004 on Aug 26, 2010 1:10 PM

  • Executing jar file does not work

    i am using net beans 4.1, jdk 1.4.2_09 and jre 5.0 update 4.
    i create a jar in netbeans, exit netbeans, go to the directory where the jar has been placed and double click the jar file to run it. when i do so i get an hour glass momentarily and then nothing. the program does not execute. i hope i am not missing something very basic here. i assume i can run the program by double clicking the jar file ....
    i have checked in netbeans to insure that all classes are in the jar, the manifest looks good, etc, etc. it looks like all the pieces of the jar are in place but the program will not run. please help.
    thanks,
    dave ...

    Directory of C:\JAVA\PROJECTS\DIST
    10/04/2005 10:09 AM <DIR> .
    10/04/2005 10:09 AM <DIR> ..
    10/04/2005 10:09 AM 25,203 gift_email.jar
    1 File(s) 25,203 bytes
    2 Dir(s) 124,456,144,896 bytes free
    C:\JAVA\PROJECTS\DIST>echo %CLASSPATH%
    c:\java\projects\dist;c:\Program Files\netbeans-4.1\ide5\modules\ext
    C:\JAVA\PROJECTS\DIST>java -jar gift_email.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/netbeans/lib/awtextra/AbsoluteLayout
    at giftrecpt.email.gift_email_gui.initComponents(gift_email_gui.java:38)
    at giftrecpt.email.gift_email_gui.<init>(gift_email_gui.java:24)
    at giftrecpt.email.gift_email_gui.main(gift_email_gui.java:142)
    C:\JAVA\PROJECTS\DIST>
    i added the location of the absolutelayout method to the classpath but still get the error. i also included this same reference in netbeans to the project under run-time libraries. so it seems that i have added the necesary references but still no luck. what could i be missing? the manifest makes no mention of class path. here it is below:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.2
    Created-By: 1.4.2_09-b05 (Sun Microsystems Inc.)
    Main-Class: giftrecpt.email.gift_email_gui
    X-COMMENT: Main-Class will be added automatically by build
    thanks,
    dave ...

  • Commands\Create AIR File\Preview not working in Fireworks CS4

    I am working on a LYNDA training video for Fireworks CS4 and am trying to Preview one of the exercises as instructed. If I click on Preview in the Create AIR File dialog box, nothing happens. Any thoughts on why this isn't working? Thank you.

    Hi Jim!
    Nice to speak to you, it's actually your video I'm following on 
    Lynda.com.
    I am not getting an error message, no, nothing happens though. I 
    installed the Adobe AIR application on Monday and was given a message 
    that it was successfully installed, so I imagine I do have the latest. 
    (I'm not sure where I actually find the application on my system 
    though so don't know how to check that.)
    I am on OS 10.5.8.
    I was actually on the Exercise 6.7 (Creating AIR Prototypes
    \Troubleshooting) where it instructs you to go to Commands\Create AIR 
    File and click on Preview in the dialog box -- so I was using your 
    file supplied in the folder. Let me know if you want me to send you 
    anything.
    Thank you!
    Paulien

  • Display Driver for TPC-2006 trying as per web soultion but not working

    Hi friendz
        Hope u all doing great. Actually we working on project for waste water treatment plant. Here its supplied with NI PAC and Touch panel 2006. Now the issue is in touch panel 2006 the displays are not clear and my client not happy with it.When i try yur web solution for Display Driver for TPC-2006 downloaded files are not running in touch panel, but for your information since i dont have card reader in my work bench computer i copied the file in different way dont know whether its correct r wrong. Steps i did was
    - Downloaded files into my desktop computer first
     - Then Inserted blank Compact Flash (CF) into touch panel.
    -  Through activesync synchronized flies between desktop and touch panel.
    - Copied downloaded files into compact flash.
    - Power off touch panel and power on no change.
    If the steps gone through correct means why files not running any other solution. If wrong is there any other way coz i dont hv card reader rite now.
    Pravin Jayapaul
    Application Engineer

    Pravin,
    Did you get the following warning when you tried to activesync the files to your touchpanel? 
    That's the reason why you should transfer the files over with a card reader. Also, make sure your CF card is at least 256MB in size. 
    Message Edited by mishkin on 03-28-2009 01:55 PM
    Misha
    Attachments:
    warning.png ‏4 KB

  • Help required - animation created in edge animate not working on chrome mobile

    Hi,
    Here is the link :
    www.knowledge-hive.com
    The animation is working well on default mobile browsers for android and iOS but it is not working on chrome mobile. Has anybody faced a similar issue?
    Thanks,
    Ankur

    Actually yes...!
    Failed to load resource: net::ERR_FILE_NOT_FOUND file://www.youtube.com/player_api
    But why only when opening the HTML directly...?
    There is another error...maybe this is the problem source:
    Uncaught SecurityError: Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://localhost:54321". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.

  • Have tried many times to do mail merge from csv file but not working have watched all u tube vids!! Please help thank you

    I've downloaded Thunderbird and have imported all emails etc - works great!
    BUT when I try to do a mail merge it doesn't work! I've saved my excel file as cvs and understand that I need to use {{Email}} , {{First Name}} etc
    It just doesn't work for me - no emails in outbox or sent items?
    any ideas please?

    can you confirm a few things?
    You downloaded 'Mail Merge' and it is displayed in the Thunderbird 'Addon Manager' and it is enabled.
    Open the .csv file and checked that the info you are entering in the Write message eg: {{Email}} , {{First Name}} etc is the same as the column headers.
    example:
    {{FirstName}} OR {{First Name}}
    {{Email}} OR {{Primary Email}}
    you can edit the .csv file to change eg: {{Primary Email}} to {{Email}}
    you can also move the column headers, so that the first three columns show : First Name, Last Name, Email

Maybe you are looking for