How to make a "Program" out of my .java files?

I have made a little application that stores a file to disk. Is there someway to make a file out of my .java files so it can be run without opening my editor and choosing run?

sorry I didn't check that, I can now run the jar command.
But even though I can create a .jar file I get an error. I have followed the guide that says I need to add the applications Entry point.
I have two classes:
saveDates.class //contains the main method
UserInput.claa // Parsing of user input
When I create the jar file I type:
jar cfe saveDates.jar SaveDates SaveDates.class UserInput.class
But when I try to run it like:
java -jar saveDates.jar
I get the error:
C:\workspace\dato>java -jar saveDates.jar
Exception in thread "main" java.lang.NoClassDefFoundError: SaveDates$1
at SaveDates.main(SaveDates.java:89)
C:\workspace\dato>
Do I need to change the main method someway?

Similar Messages

  • How to make a snapshot out of a movie file?

    How to make a snapshot out of a movie file and integrate this snapshot into the movie? Thanks, Wolfgang

    Either you use the Hold function from the Retiming popup or you export an image and reimport it.

  • How to make a search out of an image file

    I have a .gif banner for a website with a search box and
    button, all simply on one layer in the .gif file. What is the
    simplest way I can insert a text option into the search box, make
    the button active, to access the link
    "www.blablabla.com/q=searchterm"? I do not need to build a database
    as I am a graphic designer, simply to have the html code to send
    with the .gif banner to the publishers. Must I split up the banner
    in any way/edit in in fireworks?
    Would appreciate any help on this. As you may be able to
    tell, I am not experienced with DW!
    Thanks

    The text box will need to be a form element so there are two
    choices. Either
    you slice the image up around the box, or you leave it as is
    and place the
    form elements is a layer abover the image. The former is the
    better way to
    go.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "fredsters_S" <[email protected]> wrote in
    message
    news:e4iq34$qjh$[email protected]..
    >I have a .gif banner for a website with a search box and
    button, all simply
    >on
    > one layer in the .gif file. What is the simplest way I
    can insert a text
    > option
    > into the search box, make the button active, to access
    the link
    > "www.blablabla.com/q=searchterm"? I do not need to build
    a database as I
    > am a
    > graphic designer, simply to have the html code to send
    with the .gif
    > banner to
    > the publishers. Must I split up the banner in any
    way/edit in in
    > fireworks?
    >
    > Would appreciate any help on this. As you may be able to
    tell, I am not
    > experienced with DW!
    >
    > Thanks
    >

  • How to make my program forcefully errror

    hi 2 all
    how to make my program forcefully error out even i have to get data
    regards
    siva

    Hi Mate,
    Just remove the quries which you execute
    Thanks
    Kash
    www.mkashu.blogspot.com

  • How to make labview program to get average value of 200 reading from multimeter (by using loop)

    Hello
    How to make labview program to get average value of 200 reading from multimeter (I using using loop) to read voltage from mulmeter  but I like to get average value of all of 200 reding how can I do that?
    Thanks
    Wee
    Solved!
    Go to Solution.

    Another idea with less programming - take advantage of the "free" array that comes with a Chart - i.e. the  History Data.
    1) Wire your DMM data to a Chart. (You can set the chart to invisible if you don't plan on using it in the GUI).
    2) Set the Chart History Length to 200 (right click on the chart, click on Chart History Length...)
    3) On the block diagram, use the History Data Property Node, wire it to Mean.vi, and you're done.
    Easiest running average ever.
    Message Edited by Broken Arrow on 04-07-2010 11:36 AM
    Richard
    Attachments:
    EasyAvg.jpg ‏8 KB

  • How to make a key out of this data?

    Since no one replied to my last post, I'll give it another try. From an RTSP server I get two values, a key called rsaaeskey (342 bytes, without the line breaks):
      yxKBocBgTii20n9nbKfYGyGhPqtosXuq8M99yU5/PzTVNmIUsUGlpD27u
      cqN8eNFvmaO7cFVXeaMGaCfI5V+YNrd77xGQ+CUE0XFraXUvp4cF4aX1L
      ZOGe38nwX3Ba+4bQFfjmYgz3ObRuOWlw9KCi4CMP5574F+CIvutVAwtAC
      PiDFF7nVcoaBTr2QbSUile0Zs3Hyxjn9PWVaey9Nu2DgJZ8rtw6F2SkQ7
      NDHBjjUKXNIeCAeBFuV4XNiazvi3gWa4VbgITtD9jcm+7nPMAK0oBL1S3
      K3Z6FK7XVnfehYYJjRw7THMZzSvq7FtLB9QgulqQTJ3awJdwS0ACb1FkAand an initialization vector called aesiv (22 bytes):
      zcZmAZtqh7uGcEwPXk0QeAThe data is obviously Base64 encoded. However, after decoding I don't know how to make a key out of it. Trying KeyFactory's generatePublic and generatePrivate methods result in an InvalidKeySpecException with any algorithm I've tried (RSA, DSA, DH).
    I think this is a multi-prime RAS secret key (someone said they're 342 bytes long), but how do I generate a Java Key out of it?

    The rsaaeskey, decoded to binary, is a binary array of 256 bytes. Using the DUMPASN1 tool we see that the bytes are not in ASN.1 BER or DER encoding.
    C> openssl enc -base64 -d -in rsaaeskey.base64 -out test.bin
    C> dumpasn1 rsaaeskey.bin
       0 CB   18: [PRIVATE 11]
                :   81 A1 C0 60 4E 28 B6 D2 7F 67 6C A7 D8 1B 21 A1
                :   3E ABIf it were encoded in ASN.1 BER or DER encoding it will start as a "SEQUENCE" or a "SET", not as an unrecognized data.
    You need to check the exact specification of the protocol. (Are you using TSP - RFC 3161, or RTSP - RFC 2326?)

  • How to make a program for backgroung processing used servlet

    how to make a program for backgroung processing used servlet

    well i need the coding part written in servlet ,in which servlet is always ready for accepting a client request.

  • How to make a data base connexion in java?

    I have an oracle 7 data base that i want to connect how to make a data base connexion in java?

    J
    D
    B
    C
    Search these forums or follow the JDBC tutorial

  • HT203433 I am having trouble moving my music to my new computer. I have enable homeshare. it does not show any files in my homeshare. How do i get them out of the normal files into home share

    I am having trouble moving my music to my new computer. I have enable homeshare. it does not show any files in my homeshare. How do i get them out of the normal files into home share

    Welcome to the Apple Community.
    The following article(s) may help you.
    Moving your iTunes library to a new computer

  • How to view the change immediately after a java file is modified without restarting server or redeploy?

              Hi All,
              How to view the change immediately after a java file that is used in jsp is modified
              without restarting server or redeploy?
              Moreover, it is better to keep the original session.
              Any suggestion is appreciated.
              Kammau
              

              Hi,
              In order to have a new version of a java class, the current classloader must be
              deleted and a new one created. This is what redeployment does. I believe that
              this is more of an issue with Sun's implementation of classloaders. You could
              ask BEA support (719.232.7878) and see if they have any plans to periodically
              check jar files to see if java class file timestamps and destroy and re-create
              classloaders on the fly.
              1) You will still have to accept the performance hit of destroying classloaders
              and creating new ones. There isn't any way around that.
              2) I would think you would want to have more explicit control in production and
              integration anyway.
              You can redeploy applications from the command line (script) file not just the
              console.
              Hope this helps,
              pat
              "Kammau" <[email protected]> wrote:
              >
              >Hi All,
              >How to view the change immediately after a java file that is used in
              >jsp is modified
              >without restarting server or redeploy?
              >Moreover, it is better to keep the original session.
              >Any suggestion is appreciated.
              >
              >Kammau
              

  • Help, how to make a program type in a command in command prompt?

    I've got a small code that only works if you type in something like this (assume that the .java file is smallcode.java):
    c:\>java smallcode filename.dcm
    on the other hand, in my main program I have a if else ladder that I want to fit in this code, when my file chooser choose the file type .dcm, I want it to execute the command above, how can I do it?

    1. Not sure if your file is an absolute path name,
    like "c:\files\file.dcm". If it's not, then it has to
    be in the same directory as where your running
    picviewer from. I always use the absolute path just
    to be safe.you know what, you just point out how stupid I am, the path is relative, it depends on where the user surf into, I get the directory like this:
    FileDialog fd = new FileDialog(this, "Select Directory", 0);
    String directory = fd.getDirectory();
    String fileName = fd.getfileName();
    >
    2. Your command string is wrong, try:
    String cmd = ("cmd /c d:\\java
    project\\picviewer\\test\\java DicomViewer " +
    "\""+file+"\"");You are missing a space between DicomViewer and the
    file name. Also, to make sure that it doesn't parse
    the file name, put it in quotes (like I have done
    above).I see, I'll modify the code and come back in couple minutes.
    thanks

  • How to make standalone program in java?

    I have try use jar and it work. but how to access a folder that in the jar file?
    example:
    ------files---------------------------------------------------------------
    pic ( folder that storage images)
    mainClass.txt (set where is the "main" class)
    myclass.class
    main.class
    and i run in command line:
    jar cmf mainClass.txt run.jar *.*
    after that its created run.jar that store all files that i want
    In main.class i get a images from a pic folder.
    So how i get images from a pic folder after i make a standalone jar file ( get a path of image (up one folder of my main.class folder) in jar file where my main.clss is in the jar file too ) ?
    thx..

    Actually i access my image from other class, class that not contain main class, let call myclass, myclass isn't contain main class
    i hava set path
    "ImageIcon icon" in the myclass.class
    ImageIcon icon = new ImageIcon(myclass.class.getClassLoader().getResource(path));its error:
    "Could not find the main class. Program will exit"
    i try:
    ImageIcon icon = new ImageIcon(main.class.getClassLoader().getResource(path));but the same error too..
    Edited by: sayunara on Apr 18, 2008 2:05 AM

  • How to make a stationery out of .doc or .docx file?

    Hi,
    I stumbled upon a website that has some nice stationery, in .doc format. and since there few free pre made stationery available for Mail.app, at least to my knowledge, because I think I almost downloaded every free stationery available out there that could be easily found via Google. I decided to download some of these .doc stationeries and try to put them in Mail.app, but first I had to convert them into .html format. so here is what I've already tried and did not work:
    first I tried opening them in TextEdit, which supports .doc out of the box, only to find out that the pictures in the documents are gone to thin air. I tried saving it and then opening it with something else like Open Office, but the pictures were permanently gone.
    then I tried opening the original documents directly in Open Office, you guessed right If you said they will look screwed, and they were, and tried to save them as html, they were screwed even more.
    so I did a bit of research and found out that I could use Google Docs in order to convert the documents, I uploaded them into my Google docs and then tried to open them with it, but found it that Google docs can't handle the pictures (specially background pictures) either. as a result I did more searching to find a document converter and here is what I found:
    I found a few online service to convert these documents:
    http://www.freefileconvert.com/ was pretty good to convert the files into an .odt format. at first I thought yes I got the solution, now I can simply convert it to html using Open Office, but unfortunately, when I saved the document in html format and checked it in Safari to see how does it look, as If I would have done the same in MS Office with the original format, it looked pretty much screwed .
    So I continued to look and I found a few other online services one of them asked me to pay a fee, I skipped to the other one which was http://docx-converter.com/. unfortunately the website wasn't functioning properly I think, at least for me (maybe someone out there has succeeded using it, I don't know.) and it didn't send me anything.
    Finally I found http://www.zamzar.com/ that could convert .doc or .docx documents into html, or at least that is what it claims to do so, I tried it, and after I received the file via email, I found out it only contains a bmp image of the document's background. So much for the online conversion services!
    But I decided I would give it a last shot using MS Office online, so I opened up my old Windows Live mail and went into my Skydrive, I uploaded the documents and tried saving it as html, but there were no save as html (after all an online copy of MS Office should have some limitations, otherwise few people will be willing to buy a Desktop version) but this didn't made me disappointed, since I already knew, that Neither Office Word can make a clear conversion, so I tried something different, while I was in Safari looking at the document in online MS office, I saved the page as Web Archives, then I opened the file with TextEdit, and after deleting useless links and pictures, I finally managed to get a clear document with everything that supposed to be in it. At this point I only need to know how to make use of this document to create a stationery with this raw file which is in Web Archive format. any ideas?
    null

    I'm a total idiot! How did I overlook http://www.zamzar.com/ functions? I think I might have mistakenly chosen convert to BMP instead of html. I tried it and the result was very good.
    OK I finally found a good solution for this problem, so everyone out there that has the same problem, here is what I did:
    1. OK if you have some .doc and .docx file formats and you want to convert them into something like .html or .odt, without having to reedit the code or getting a screwed document, use http://www.freefileconvert.com/ in order to convert them into .odt so they would look as they do in MS office just go to the website and upload your documents then choose .odt, then click convert, after a few moments you will get a link to download your .odt files. you can use and play around with your document in Open Office, I have tested it and it's really good.
    2. Or if you want to convert them into .html with a clean code, and all the elements in it, simply go to http://www.zamzar.com/ and then ulpoad your documents, choose .html and enter your email address, you will have your .html files zipped and sent right in your inbox, then you could use Kompozer like me, or any other html editor, to make a template out of it. I tried it and the result was nice, now I have a bunch of nice html files that I can use to make templates and email stationery.

  • How to make my program case - in sensitive?

    Hi,
    Iam writing a SELECT query in report for retrieving the address number by giving address details like street, city and post code.But my program is case sensitive such that if the user inputs either in Upper Case or Lower Case, it will not work.
    For eg: suppose the city is Cape Town. If the user inputs like CAPE TOWN or cape town ( via Selection Screen ), then it won't work.
    How can i  make my program case- in sensitive?? please suggest..

    This is possible. I have done something similar to it in my search programs.
    For this we need to make a subroutine. In this subroutine we first need to convert the case into upper case using
    TRANSLATE string TO UPPER CASE.
    then prefix and postfix this string with &,
    _and if this does not work then we have to break the srting entered by the user on basis of spaces and prefix and postfix it with &. _
    Now pass this string to the query and it will definitely get the result.

  • How to make my program work using 2 files separately?

    My main file is ExpenseTracker.java. When u
    compile the ExpenseTracker.java , there is a column of buttons on the left
    and a right box. I would like to make the output of the RecordMenu.java
    appear(not pop out) in the right box of my ExoenseTracker when i click one
    of the button 'Record Expenses'. I wonder you can help me in this? I am
    facing that problem right now.=======================================================================
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class ExpenseTracker extends JFrame {
    public ExpenseTracker() {
    super("Expense Tracker");
    // FirstPanel
    JPanel FirstPanel = new JPanel();
    FirstPanel.setLayout(null);
    JLabel labeltracker = new JLabel("Expense Tracker");
    JButton recordExpenses = new JButton("Record Expenses");
    JButton viewExpenses = new JButton("View Expenses");
    JButton calendar = new JButton("Calendar" );
    JButton exit = new JButton("Exit");
    labeltracker.setBounds(40,120,135,30);
    recordExpenses.setBounds(25,160,135,30);
    viewExpenses.setBounds(25,210,135,30);
    calendar.setBounds(25,260,135,30);
    exit.setBounds(25,310,135,30);
    FirstPanel.setBounds(5,5,200,500);
    FirstPanel.add(labeltracker);
    FirstPanel.add(recordExpenses);
    FirstPanel.add(viewExpenses);
    FirstPanel.add(calendar);
    FirstPanel.add(exit);
    //SecondPanel
    JPanel SecondPanel = new JPanel();
    SecondPanel.setLayout(new BorderLayout(1,2));
    // SecondPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
    SecondPanel.setBorder(new LineBorder(Color.black));
    SecondPanel.setBounds(210,120,530,270);
    getContentPane().setLayout(null);
    getContentPane().add(FirstPanel);
    getContentPane().add(SecondPanel);
    setSize(800,500);
    setVisible(true);
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    public static void main(String [] args) {
    new ExpenseTracker();
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class RecordMenu extends JFrame implements ItemListener,ActionListener {
    >>
    JCheckBox weekly;
    JCheckBox monthly;
    public RecordMenu() {
    super("Choose");
    Container c = getContentPane();
    JPanel checkPanel = new JPanel();
    checkPanel.setLayout(new GridLayout(4,2));
    checkPanel.setBorder(new TitledBorder("Record Expenses"));
    JLabel label2 = new JLabel("Amount to track:");
    JTextField amtField = new JTextField(5);
    //Create the check boxes.
    weekly = new JCheckBox("Weekly");
    weekly.setSelected(false);
    monthly = new JCheckBox("Monthly");
    monthly.setSelected(false);
    //Register a listener for the check boxes.
    weekly.addItemListener(this);
    monthly.addItemListener(this);
    amtField.addActionListener(this);
    //Put the check boxes in a column in a panel
    checkPanel.add(weekly,BorderLayout.NORTH);
    checkPanel.add(monthly,BorderLayout.SOUTH);
    checkPanel.add(label2);
    checkPanel.add(amtField);
    JPanel buttonPanel = new JPanel();
    JButton buttonOk = new JButton("OK");
    JButton buttonCancel = new JButton("Cancel");
    buttonPanel.add(buttonOk);
    buttonPanel.add(buttonCancel);
    c.add(checkPanel,BorderLayout.NORTH);
    c.add(buttonPanel);
    setSize(370,200);
    setVisible(true);
    /** Listens to the check boxes. */
    public void itemStateChanged(ItemEvent event) {
    public static void main(String[] args) {
    new RecordMenu();

    but i wan e program to work wit 2 file, not all e 2 file codes put together in a file. I wonder if can call e code from the recordmenu file when i execute the expenseTracker file. I not sure i explain this way u will understand?
    When the record menu 'ok' is clicked there will b a JOptionpane tat will pop out saying
    'Total amt to b tracked on a weekly basis is (amt entered in textfield)"
    if e checkbox is selected weekly, the output will be like e above
    otherwise it will display 'Total amt to b tracked on a monthly basis is (amt entered in textfield)".
    ya e textfield input must be numbers.

Maybe you are looking for

  • HT3951 how do I unlock my ipod touch

    My children locked up my ipod and it is saying ipod disables connect to itunes..I am connected to itunes now but still nothing..Please help me

  • Importing AIA Xpath Functions in to Jdeveloper

    Hi, I have a requirement of using aia Xpath functions, i downloaded the AIAXpath zip folder form metalink and edited the setup.ev to Jdev home even after running the bat file restarted the system but could not see the aia Xpath functions in my Jdev d

  • Adobe Flasher Won't Install

    I've have tried everything I can think of to try to install adobe flasher. I had it on this computer for a long time and now it just won't install properly. Everytime i try to install it, it says that I need to install the Active X. I then try to ins

  • Is OWA_PATTERN in Oracle SE?

    Dear Sirs: I'm in doubt! I've looked through the OWA_PATTERN package which is a part of PL/SQL Toolkit. I like it very much and I really need it! But my team leader requests to make our code to be able running on Oracle Standard Edition (so our custo

  • Why does the menu break every time I adjust it?

    The menu drop downs seem to lose functionality as I change it.  This only gets worse each time I publish/preview it.