Pulling a program out of the IDE

I have been playing with pulling small progrograms out of my Integrated development environment (IDE); writing them to CD; and installing them on other desktops, just as an exercise in the case I want to deliver some applications to a friend.
The overall requirements(steps) are not clear to me.
1.the directory organization
2. the file (jar) creation
3. the D0S (java.exe) window
Are some of the issue that come to mind.
I have been able to use a desktop icon and set the path to a program.class file and run it--making the program window appear but the java.exe Dos window also appears.
So far, the number of texts I have give no step by step instructions on how to configure an environment without an IDE with the java VM already intalled, or how to pull a program out of the IDE and install it along with a copy of the VM on another machine.

Good question. Lot's of people don't know this, and I can't even say I have all the right answers. There are probably numerous ways you could do this. The best way, if you have the money, is to buy something like InstallAnywhere or Wise that provide professional installations. Not only will your install look like professional installation of stuff like Photoshop, etc but it will also handle issues like OS platform specifics, environment variables, registry entires (if possible), the proper JRE/JDK installed... if not install it, uninstallation features, and so forth. That is by far the best way to go.
However, often you just want to bundle something up and send it out to a few friends, family, etc. You could of course look for an open source or freeware utitlity and no doubt there are some out there. Or, you could do what a lot of people do now, use the Ant tool (written in Java) and have a build script that does everything for you. I have a simple template build script that is used for various tasks. In our work setup, it does local dev (incremental) compiles, and if necessary packaging it up into .jar/.zip files. My single build script can also run junit tests and reports, builds executable packages into .zip and .jar's as necessary, will do a clean build (great for making sure any code changes don't break some code elsewhere, thus ensuring that your normal incremental build process is not missing something), it can FTP or copy files to locations, it can email results, and so forth. If you don't know about ant, I STRONGLY suggest you learn it quickly, and to me there is no better way than buy the book Java Development with Ant. Two of the main Ant developers/committers wrote the book and it does an excellent job of teaching you about all the different uses of Ant, including the template build script I now use. It is well worth the $40 or so you'll find the book for, and within a week you'll have a good build template that you can modify for specific projects.
Now, in terms of the 3 things, well, the directory organization is always changing. Each project may have something different, but here is one that I usually use:
<root project dir>: (below this you'll find)
/src - location of all src files
/src/java - the location of the project specific java code
/src/examples - if need be (especially useful for frameworks and API's you wish to share) show example applications using the output of the /src/java code
/src/test - location of JUnit, jfcUnit and other test files to unit test your code (very important, should be done no matter what!!)
/lib - location of any 3rd party libraries you need, both for compilation and runtime. Keep in mind that your build script may pull only a subset of these libraries in for runtime. For example, the /src/test that uses JUnit will require the junit.jar file. You won't need this for runtime, so your build script sets up a compile classpath with junit.jar, and a runtime classpath that will exclude junit.jar, perhaps others.
/dist - the location that the build script puts all distributable files. This would be any executable .jar file, any .zip file, perhaps other files necessary for distribution. If you were making a large application and planned to burn it to disk, instead of a single .zip file, you may actually build the sub-dirs below the /dist/<your app> type of dir, so that you can simply burn from that <your app> dir to the root of the cd.
/build - location of all compiled classes, including from /src/java, /src/examples, /src/test.
/build/classes - the location of compiled java code
/build/test - the location of test results, including perhaps test data to be used by the test code, and possibly the output dir of test reports
- /build/test/reports for example for output of test reports.
/doc - location of any documentation, including the JavaDoc produced by the build script from your src.
<project root> - this is the location of your build.xml ant build script, if need be. The build script, as you would learn in the book, is set up so that you can move it anywhere and it will still build your project correctly. You may opt to put it in the /scripts dir instead and keep the project root super clean.
/misc or /etc - common location to put things like properties files, misc files used to build projects. For example, in the building of a EJB application (.jar or .ear file), you will no doubt need the META-INF/application.xml file. Or in a .jar file you need a special META-INF/manifest.mf file. The /misc or /etc dir is a good candidate for these types of things. You can even package it up in your app so that in the .jar file you have /etc/properties/somepropertyfile.properties, and in your code do a simple getClass().getClassLoader().getResource("/etc/properties/somepropertyfile.properties") to always ensure you pull it from this directory. OR, your build script can "change" the location this file goes. It is all up to you.
That is what I use for all my projects, the dir structure anyway. What you do to build your .jar/.zip files is up to you. You usually don't need to pull the /src dir, the /dist dir, etc into your .jar/.zip files. Normally you'll have the compiled classes at the root. So in your project dir on your disk, you may have <project root>/build/classes/java/org/mycompany/ui/Main.class, and in your .jar file it would simply be <root of .jar file>/org/mycompany/ui/Main.class, and your build file can easily "change" the root path (using <zipfileset prefix=""> task) to change the path of any file. But more of that can be learned in that book and by looking up resources on the net. The Ant JavaDoc API is very good at explaining most of these as well, and there are TONS of ant scripts in most projects to look at for examples.
The file creation, well, as I said Ant has built in tasks you can use to create .jar files, .zip files, etc. All of that is all built in to how Ant works.
As for java.exe, well, in a professional app, you usually do one of two things. You either write a simple C/C++/Delphi/some other languages .exe wrapper (for windows) that internall executes the java.exe and runs the JVM to hide the window, as well as provide a .exe file to look more "native", or you run javaw.exe, which hides the Console output window for most apps. NOTE: if you create a .bat shortcut on your desktop to javaw.exe, you will STILL get a console window that shows up. ALL shortcuts to .bat files will always create a console window. Many java developers don't understand why they run javaw.exe from a shortcut on their desktop and still see the console window.
Now, hopefully that helped a bit. But if not, or you still have questions, I am watching this thread so fire away and I'll help more.

Similar Messages

  • How can I select the Quicktime plug-in (in Firefox) as the Helper Application, as only programs out of the web browser are shown?

    I recently updated my QuickTime Plug-in (7.7.4) on Firefox 21. Prior to the update, I could open midi files in the Firefox and other browsers with a QuickTime Player. Now, I've got my Windows 7 computer asking how it should save or open the file. The QuickTime Plug-in is enabled and works with other types of files. If I open Tools, select Options, and select Applications, I do have the option of selecting "Use QuickTime Plug-in 7.7.4 (in Firefox)" for many file types. For the "Midi Sequence" type, it isn't an option, (only programs which open the midi files outside of the browser). Presently my only option is to use "Windows Media Player" as the default program, (opening midi files outside of the browser). "Mid file" allows the selection of the QuickTime Plug-in but still goes out of the Firefox browser to use the Windows Media Player, whether the file's extension is .mid or .midi
    Is these someplace I can find the "Use QuickTime Plug-in 7.7.4 (in Firefox)" with the "Browse" within my computer's files, or am I now stuck using the "Windows Media Player" when a plug-in should be able to do this simple task? I can watch YouTUbe (in Firefox) but cannot play a midi file (in Firefox)!

    QT 7.7.4 use "audio/mid" MIME type only and does not understand now "audio/midi" and "audio/x-midi" types commonly used on server side. Blame Apple for that.

  • HT4528 I pulled my iPhone out of the docking station/speakers and now the ring tones don't work.  Anyone know a fix for this?

    Does anyone know if there is a fix for iPhone 4S when you pull it out of the docking station and now the ring tones don't work -- it only vibrates.

    Basic troubleshooting of the device is reset, restart, restore (first from backup then as new).  Has any of this been tried?
    Do other sounds work?
    Have you checked to see if the dock connector or headphone jack have debris in them?

  • In AS3 how can you detect if someone pulls their camera out of the USB port?

    In AS3 if the SWF gets a hold of someone's camera successfully and they start streaming video across and everything, but then mid-stream, either they accidentally wiggle their camera out of the USB port, or the camera just sort of breaks down, or something else like that, how could you detect it from that user's side?  I've tried using event listeners and also polling different variables every five seconds, but neither has worked; none of the public properties of Camera or its events seem to act funny at all when something like that happens.  And apparently you can't just keep scanning the computer for devices (for good reason, I guess).
    Is there something I'm missing here?  Is there a way to detect from a user's copy of a SWF (FP or AIR, but much more importantly FP) when their camera has effectively stopped as the result of something going wrong, such as them wiggling it out of the computer by mistake?  If so how?  Thanks!

    Run your code and disconnect your camera. What are the common properties of it? Does your stream stop? Return only a specific color frame? Those things are usable to detect it but you're right in saying you can't detect much more than a loss of packets from a NetStream object.

  • Best animation program out of the CC programs?

    I understand that Adobe has programs like flash pro, after effects, etc, but what is the absolute best and core animating program from the CC arsenal?

    Each of them can be the "best" for a specific type of animation, so on a general level your question doesn't really make sense. Character animation has different requirements than visual effects, creating animated GIFs or web animations is different from broadcast work, you know...
    Mylenium

  • How do I download one program out of the creative suite once a trial has expired???

    My trial of adobe illustrator was still active when I downloaded my creative suite for mac. However once my trial has expired, the serial number for my pack doesn't work when I type this in to license the software?

    CC doesn't use serial numbers. It's solely based on your Adobe ID. If you have a redemption code from a prepaid voucher, refer to this:
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    If the programs wrongfully request a serial number, then this would be relevant:
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    Mylenium

  • Pulling my ibook out of the closet :o)

    Long Story Short:
    I bought this ibook in 2001/2002: serial # UV149xxx. I wasn't ready for the Mac experiance and it has been sitting in the closte untouched. I purchased an Airport card to surf WiFi and it works no problem. All I REALLY want it to do is have it recognize my ipod (2008 ).. but all it has is iTunes 2 - it won't take the apple iTunes7.7 currently at the apple store... any feedback ?
    thanks !

    You will need at least OS X Tiger 10.4.x to be able to use the latest version of iTunes.
    Also to note: these iBooks only have USB 1.1 - which means your iPod will only sync very s l o w l y, so you might consider just upgrading your hardware to something else that has the newer USB 2.0 - then your iPod will be even happier!

  • Program not behaving the same after making it a JAR

    Hello,
    I'm developing a program using Eclipse and wanted to export a JAR file to test out. I was able to successfully make the JAR file and it does run, but not as expected. For example, I have the following code which opens up a JFileChooser and lets the user select multiple files to be stored in a JList (via a list model). When I run this from the IDE during development, it works as it should, allowing me to select multiple files from the JFileChooser and adds all of the files to the JList. However, when I run the JAR, it lets the user select multiple files but only adds ONE file to the list. Not only that, but it doesn't seem to be running my "loadComparePaper()" method after adding the item to the list model.
    JFileChooser fileChooser = new JFileChooser();  // New JFileChooser
    fileChooser.setMultiSelectionEnabled( true );     // Allow multiple files to be selected
    FileFilter docFilter = new ExtensionFileFilter( null, acceptableFiles );  // "acceptableFiles" is an array of allowable extensions (not shown in this snippet)
    fileChooser.addChoosableFileFilter( docFilter );  // Tell the JFileChooser to use my filter
    int returnValue = fileChooser.showOpenDialog( null );  // Open the dialog; store result
    if ( returnValue == JFileChooser.APPROVE_OPTION ) {
        File[] selectedFiles = fileChooser.getSelectedFiles();  // Get selected files; store in array
        for ( int i = 0; i < selectedFiles.length; i++ ) {  // For each selected file..
         compareListModel.addElement( selectedFiles[ i ].getName() );  // Add file name to list -- getting stuck here!
         loadComparePaper( selectedFiles[ i ] );  // Call method to load this file (read it)
    }It seems like it's not running the whole for loop, because only one item is being added to the list and it never reaches "loadComparePaper()". Again, it works during development in the IDE and I've tried exporting the JAR quite a few times to see if that was the problem, but the JAR itself is executing.
    Any ideas? I'm baffled as to why it works while I'm testing it out in the IDE, but after I export the JAR it's not working properly. Do you think this has something to do with Eclipse? Has anyone else experienced a problem like this?
    Thanks

    ThomYork:
    Thank you for the advice. I'm new to using JARs and foolishly forgot or didn't realize that I should run it from the console to check for errors. Well, it seems this is the problem: I'm using Apache's POI package and have it stored in the directory +/my_project/lib/poi/+. Within the +/poi/+ folder are 3 JAR files that my program references. When I run my app from within the IDE, I don't get any errors because I've included them in the build path. However, when I run my JAR, it can't find the classes -- it doesn't seem to be looking in the +/lib/poi/+ folder even though my JAR file is in the same root directory as the main class when I run it within the IDE (i.e., both my_main_class and my_main_jar are in the same level directory, and would need to look in the +/lib/poi/+ folder for the other packages).
    So I guess my problem is... my JAR file doesn't "see" the path of the other packages I'm using. In Eclipse, I've configured my project to include these other packages in the build path (and also the "Order and Export" build path) so I thought it would include them, but that doesn't seem to be working.
    Am I missing something? How do I include JARs in other packages / folders so that they work in my JAR?
    Thanks again
    EDIT: I see some other people on this forum experiencing similar issues and I noticed you've helped them out. I tried creating a manifest file, but that didn't work, either... just to be more specific, this is the error message I'm getting:
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/POIFSFileSystem
            at OneToOne.loadSourcePaper(OneToOne.java:907)Edited by: ibanezplayer85 on Aug 14, 2008 10:19 PM

  • Updated Process for the Ideas Exchange

    Hey folks! Spotify Community team here.
    If you've been around the Spotify Community for a while, you've probably noticed that we keep tabs on your suggestions for improving Spotify through our Idea Exchange. 
    In an effort to keep the Idea Exchange as organized and up-to-date as possible, we've changed the way Ideas are submitted. We've outlined the new process with a step-by-step guide below. 
    We hope that you continue submitting ideas to make Spotify even better.  While we can't promise that we'll implement every idea that you submit, but we'll always do our best consider each one and provide updates wherever possible. 
    The guidelines:
    Search for previously submitted ideas.  Someone may have already submitted the same idea.
    One idea per post.  No double dipping.  
    Ensure the idea is implementable.  Avoid posting general feedback or questions in the idea exchange--the more specific the idea the better.  
    Use an intuitive title.  
    Submitting a new idea:
    1. Go to the Idea Submissions Board.
    2. Click the New Idea button.
    3. Enter an Idea Subject that includes one of the tags above. 
    4. In the Body enter a detailed description of your idea, including any screenshots or links you'd like to share. 
    5. Select one a platform label.
    6. Then select a subcategory label.
    7. Click Post. 
    8. One of our Idea Guardians in the Rock Star Program will analyze the idea and mark it either as a "Live Idea" or close it for a specified reason (duplicate idea, unspecified, etc). Allow us to introduce our Idea Guardians: Marco, FredJ, gprocess, Peter, dinomight, Anthony, pnc, Jordi, kbrooksc, Carina, OviiiOne, and Rodrigo.
    9. If your idea reaches the Live Idea board it can then start to gain kudos and comments from other users.
    10. Once your idea reaches 100+ kudos a Community Manager or Moderator will update the status to one of the following:
    The Idea statuses: 
    New Suggestion (no status/default one): the idea was just posted, it is waiting to be reviewed by an Idea Guardian.  
    New Idea: this is a new and unique idea, you can add your kudos here. 
    Inactive Idea: Ideas that could not gather at least 25 kudos per year will get closed - you can submit this idea again if you still feel the topic should get some attention. We recommend changing the title or description if posting the same idea again.
    Good Idea, give it some kudos: We like this idea. A decision has not been made but we want to see how much the Community continues to vote on it.
    Under Consideration:  This has been brought up internally. 
    Watch this space: This feature is coming. We have a rough pipeline for its release. 
    Not right now: We talked about this internally and it’s not on our pipeline for the next few months or more.
    Case Closed:  We talked about it, but we won’t be running with it. Thanks anyway!
    Implemented:  This feature has rolled out on the specific platform.
    Needs more info:  We need more clarity or information around this idea from the original poster.
    Curious for more information about the Ideas Board? Check out The Ideas Board: How your feedback reaches Spotify.
    Thanks for your continued feedback and contributions everyone,
    The Spotify Community Team 

    Ah, yes, now I see it. For those of us with less than perfect vision, how about putting the text in red in the center of the page as opposed to in only slightly darker green to the right. I've never used this page before so I had no idea there even was something to select on the right hand side. Also, the first link in the first post on this page gives me this: "You do not have sufficient privileges for this resource or its parent to perform this action.Click your browser's Back button to continue.Return to my original page"

  • I would like to know how to draw up a list in a cell (like a pull-down menu) to ease data capture, but I don't know how to do that  ! Do you get the idea ? Thanks !

    I would like to know how to draw up a list in a cell (like a pull-down menu) to ease data capture, but I don't know how to do that  !
    Do you get the idea ?
    Thanks ever so much !

    the numbers manual can be downlaoded from this website under the Apple support area...
    http://support.apple.com/manuals/#numbers
    What your looking for is written out step by step for drop downs and all other special types of user input starting around page 96 in the '09 manual.
    Jason

  • Getting an error when using adobe photoshop CC, "Could not move the data because of a program error". Any idea on what this means?

    Getting an error when using adobe photoshop CC, "Could not move the data because of a program error". Any idea on what this means?

    Have no idea of what you were even doing in Photoshop my crystal ball is out for repairs so I can not see.  

  • On my 4 yer old imac when I run aps/programs or on the net with my Itunes runnig everything runs super slow, turn off itunes all runs fast again, any ideas

    On my 4 year old imac, when I run aps/programs or on the web "with my Itunes runnig" everything runs super slow, when I turn off itunes all runs fast again.  Note I have upated all software.  Any ideas out their.  Thanks William

    2gb of RAM is not a lot for keeping too many apps and the OS running comfortably. Have you tried running with as few apps open as possible at any one time - preferably just the one you are currently using, to see if this improves performance?
    Also, you could launch Activity Monitor in the Utilities folder and it'll give you an idea of what is going on memory-wise.

  • After i plug in my iphone 5s, it always asks me to trust the laptop, i click trust and my laptop makes that noise as if I've pulled my phone out, but i haven't, so now my itunes doesn't recognize my phone, please please help me?

    After i plug in my iphone 5s, it always asks me to trust the laptop, i click trust and my laptop makes that noise as if I've pulled my phone out, but i haven't, so now my itunes doesn't recognize my phone, please please help me?
    THis also happened with my old iphone 4s
    I need help!

    Hi loist,
    Thanks for visiting Apple Support Communities.
    If your iPhone is not being recognized by your computer after you click "Trust," the troubleshooting steps found here can help:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Cheers,
    Jeremy

  • Anyone know how to get out of the edge program?

    I dropped my old phone in the toilet and it was not time for an upgrade. Therefore, I went to the get a phone under the Edge Program. I specifically asked the rep at the store if I could go back to two year contract after I paid off the 50% of the program and he said yes. I hate this program. I only did it because I needed a phone and was not due an upgrade.  Now I understand that the only way I can get out of the Edge Program is to pay off the entire balance of the phone...which is outrageous. I no longer want to pay monthly installments. I want to pay a one time 2-year upgrade fee and start a new contract. It is my understanding my only choice is to pay off the entire edge or return the phone to Edge up. Problem is my phone has a small crack that I didn't realize was there until my son told me about it.  If you look at the phone normal you don't see it but if you look at it from an angle you can see the crack.
    I only want to get out of Edge. I will have paid off 50% by January and want to go back to a normal 2-year agreement...but I do not want to return the phone although I will if I have to, that is if they will take it back with a crack.  Otherwise, I would need to pay the insurance to get a new phone and then turn it in. This still cost me money. I am contemplating just paying off the rest of the balance and then maybe it will say I can get a new two-year contract, like it does for the other phones on my account.
    I have been a verizon customer way back when it was called Bell Atlantic Mobile and you would think they could do something for me since I have been a good customer all these years.  I don't want to leave because I have four other phones and a tablet with Verizon but I will if I have too. I would obviously go to AT&T. 
    Does anyone, maybe a verizon rep, have any options for me?

    rellis64 wrote:
    ... I only want to get out of Edge. I will have paid off 50% by January and want to go back to a normal 2-year agreement...but I do not want to return the phone although I will if I have to, that is if they will take it back with a crack. 
    Does anyone, maybe a verizon rep, have any options for me?
    I'm not a Verizon rep, just another customer like you. EDGE is a payment plan, or Rent to Own, or a lease program if you intend to keep upgrading.  If you want off the EDGE program, you can pay off the total balance due on the phone and keep it, and then you can start a new two year contract with a different phone. 
    In order to return the phone at the 50% point, and be done with EDGE, the phone has to be in good working condition.  The crack means it's not in good condition, so you will be charged the full price, whether you plan to EDGE up or go contract.  Either way, you'll end up paying for the EDGE phone, over time or in a lump sum.  It was one way to get a new phone when you were not eligible for the discounted price on your previous phone, but you need to fulfill that obligation before you can get another discounted phone.
    Do you want a new phone/different phone?  Look at eBay or swappa, or check with your friends who may have something you can borrow.  Or simply keep using the EDGE phone until it's paid for, then look at options at that time.

  • I am trying to setup my new time capsule but it is not working. after entering the airport utility and locating the TC, after I tell the program to continue, the unit just disappear and the setup menu says there is an error. Any idea of what is happening?

    I am trying to setup my new time capsule but it is not working. after entering the airport utility and locating the TC, after I tell the program to continue, the unit just disappear from the menu and the setup menu says there is an error. I tried using the wireless connection, and also the cable, but none worked. Any idea of what could be happening?

    What are you setting it up as.. join wireless network .. the very worst setup, it will disappear.. reboot the whole network in order modem. router TC.. clients and it will likely reappear.
    Tell us what network setup you are using..
    If you setup with cable to a computer completely isolated from the network with TC also isolated.. finish the setup of everything you want. .before update.. then plug it into the network. .then restart everything in correct order.. it will work most of the time.

Maybe you are looking for

  • HP Photosmart 7510 will not print in black - brand new HP cartridges

    I just replaced both black cartridges (photo and XL) now printer will not print in black. Even my test page will not print the black. I cleaned the print heads also still nothing.

  • How do I convert a .pages file to a  .word file that is not "too small" to open?

    I create a newsletter, make a copy for the printer as .pdf and another as .doc for a web site manager.The .doc I have been told cannot be opened and is listed as quit small. I have no idea if .doc is being "zipped"  when I prepare to send, which the

  • Help regarding my payment

    hello support team,                                 i purchased 6.99 CAD subscription for calling Philippines 60 mins 1 month on march 8 , 2014 by payment method paybycash... recently my talktime was over so i decided to renew again my subscription ,

  • ALE Vs XI

    Hi Experts, we have below scenario R/3-(IDOC)--->SAP BC------>Adaptris----->SonicMQ the management suggested to implement the scenario by replacing BC with SAP ALE. R/3-(IDOC posted using ALE)------>Adaptris----->SonicMQ but I think XI would be good

  • Having trouble with py-game install MacPosts

    I tried to install py-game using sudo post install py-game but when it tried to make the py-game the failed with exit status 1. The problem was parse errors and other format errors in the include file in /opt/local/include/SDL/SDL_syswm.h. Does anyon