Page 1 of 3 123 LastLast
Results 1 to 20 of 42
  1. #1
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Launch Configuration

    How can I clear the list of Launch configurations, or add a new one to the list? I'm trying to export a Runnable jar but my current project isn't listed.

    Posted to Eclipse forum... if it doesn't stay here, it's not my fault.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    That are two completely unrelated things. To remove/add/edit launch configs you got to run-> run configurations...

    To export a runnable jar open the package explorer, right click your project and select export. Click Java-> jar file and complete the wizard. Make sure to enter the correct manifest information.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    That are two completely unrelated things. To remove/add/edit launch configs you got to run-> run configurations...

    To export a runnable jar open the package explorer, right click your project and select export. Click Java-> jar file and complete the wizard. Make sure to enter the correct manifest information.
    I don't know that they are unrelated. The runnable jar wizard won't let me complete the process without at least one lanch configuration.
    Manifest info?? Because I could not get a working runnable jar with the launch configurations I had, and the fact that I deleted everything related to them, I deleted all the launch configurations and made one new on based on the project I'm working on now. Exported a "Runnable jar" to my desktop, but double clicking it does nothing. Can you expand on the "manifest information please?

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    The manifest file specifies what the main class is. If there are multiple classes the RE has to know which call to run. This tutorial on jars is not to bad: Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    The manifest file specifies what the main class is. If there are multiple classes the RE has to know which call to run. This tutorial on jars is not to bad: Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)
    I'll go through the tutorial, but I think most of this is my lack of understanding how Eclipse works. I've now tried every combination possible for saving a Runnable jar, and they all do nothing. It seems they are opening for a split second, then nothing. In Eclipse the class opens and works fine. Is there another way I can send this to a friend (who has no JDK or knowledge of Java) and let him run it?

  6. #6
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    That's the problem. Learning a programming language is one thing, learning to use an IDE is the next thing. That's why I tell beginners to use a text editor (like Notepad++) and the command line to compile things until they've mastered path, classpath, packaging and deploying jars. All this will hide an IDE from you and you've just found out how important it is to know these basics.

    There's no easy way for your friend to run it without you providing a runnable jar.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  7. #7
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    That's the problem. Learning a programming language is one thing, learning to use an IDE is the next thing. That's why I tell beginners to use a text editor (like Notepad++) and the command line to compile things until they've mastered path, classpath, packaging and deploying jars. All this will hide an IDE from you and you've just found out how important it is to know these basics.

    There's no easy way for your friend to run it without you providing a runnable jar.
    I made Runnable jar files before, so I know the wizard. but because I was having some problems with paths I removed and reinstalled Eclipise in the root of C:. Since then, I've only made 2 projects and only have one class file in the project I'm trying to export. I now only have one launch configuration to choose from. From this information can you determine or guess what I need to do to make a runnable jar? I don't think I can do it from the command line.

  8. #8
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    Not really, the normal procedure is in my reply #2
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  9. #9
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by PhHein View Post
    Not really, the normal procedure is in my reply #2
    I've searched all the folders for a manifest file and find none. The tutorial says I will get one automatically made for me if I create a jar. I did that and if I extract the so-called "runnable jar" it does have a manifest file with the path to my class. So why is this file not runnable?

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: Launch Configuration

    What happens when you try and run the generated jar file from the command line using:
    java -jar <your jar file>
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    What happens when you try and run the generated jar file from the command line using:
    java -jar <your jar file>
    Same as if I double click the jar on my desktop. It seems to try to open then closes all in less than 1/2 second. I've run it from the command line several times now, and I see a window of some sort flash open, but it is not in the location where my JFrame should be, so I think it is a command line window.
    Last edited by NotTooOld; 04-11-2013 at 05:07 AM.

  12. #12
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    What happens when you try and run the generated jar file from the command line using:
    java -jar <your jar file>
    I take back what I said about thinking it was opening my JFrame when I double click the runnable jar, or open it from the command line. The position on the screen is wrong. It must be briefly opening a command line window. It closes again so fast that I can't see anything in the window though.

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: Launch Configuration

    If it does that from the command line then it will not be another command line window.
    It will be your application.
    Stick some debugging in the main() method so you can see where it is going.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  14. #14
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    If it does that from the command line then it will not be another command line window.
    It will be your application.
    Stick some debugging in the main() method so you can see where it is going.
    I am using Windows XP, and when I say I run it from the Command line, I should say I run it from the "Run" menu item in the Start menu. With the class open in Eclipse, everything works fine now. What kind of debugging could I put in the main method? It just seems Eclipse is messing something up when I export to a Runnable jar.

  15. #15
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    And I don't know if this will help to figure out what's happening, but I saved the project in a zip file, sent it to my laptop, opened the zip there and the app runs fine when I double click the AlphaPlay.java file. (class file - the same file the manifest points to) I'm trying to get help in the Eclipse.org forums too, but no replies in 2 days there.

  16. #16
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by NotTooOld View Post
    I am using Windows XP, and when I say I run it from the Command line, I should say I run it from the "Run" menu item in the Start menu. With the class open in Eclipse, everything works fine now. What kind of debugging could I put in the main method? It just seems Eclipse is messing something up when I export to a Runnable jar.
    OK, now I may be getting somewhere. I just tried the 3rd option for exporting a Runnable jar. "Copy required libraries into a sub-folder next to the generated jar. That sub-folder is empty. I need to somehow tell the Export Wizard that I need the files folder and it's contents.

  17. #17
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: Launch Configuration

    Quote Originally Posted by NotTooOld View Post
    I am using Windows XP, and when I say I run it from the Command line, I should say I run it from the "Run" menu item in the Start menu. With the class open in Eclipse, everything works fine now. What kind of debugging could I put in the main method? It just seems Eclipse is messing something up when I export to a Runnable jar.
    So you haven't opened a command window (cmd)?
    You need to do that to see the actual error.

    But it does sound like you are missing the dependencies.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  18. #18
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    So you haven't opened a command window (cmd)?
    You need to do that to see the actual error.

    But it does sound like you are missing the dependencies.
    I have not run cmd. Right now I'm messing around with the build path wizard/thingy. I'm trying to manually tell it where everything is but I just got this weird error message at the top. "Cannot nest 'AlphaApp/files/G' insi...exclude 'G/' from 'AlphaApp/files'" I have folders A-Z in there. Why would one, "G", get excluded? it is an empty folder so far. I'm probably making more problems messing with something I don't know about. I'll try the cmd now. It's been too long since I used the command line. I need to find a list of commands.
    Last edited by NotTooOld; 04-11-2013 at 10:31 AM.

  19. #19
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Launch Configuration

    Quote Originally Posted by Tolls View Post
    So you haven't opened a command window (cmd)?
    You need to do that to see the actual error.

    But it does sound like you are missing the dependencies.
    C:\java -jar AlphaPlay.jar
    java.lang.NullPointerException
    at javax.swing.ImageIcon.<init><Unknown Source>
    at biz.mybiz.alpha.AlphaPlay.<init>AlphaPlay.java.68>
    yadda
    yadda
    yadda.

    could only be the paths in my class ( which work properly in Eclipse ) or the resources are not in the jar... or maybe a few hundred other things.

    To get the dependencies set up right, am I on the right track messing with the Build Path???
    Last edited by NotTooOld; 04-11-2013 at 10:45 AM.

  20. #20
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Launch Configuration

    You can rename the .jar to .zip and have a look whether the resources are in it and what the path within the jar is.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 08-23-2013, 10:18 AM
  2. Launch Jar from in application
    By hardcorebadger in forum New To Java
    Replies: 3
    Last Post: 01-25-2011, 06:03 AM
  3. Create a launch configuration file
    By juza in forum Eclipse
    Replies: 0
    Last Post: 03-24-2010, 12:55 PM
  4. Launch configuration
    By skittle in forum Eclipse
    Replies: 0
    Last Post: 02-28-2010, 11:57 PM
  5. Launch Error
    By roughjj in forum Eclipse
    Replies: 1
    Last Post: 10-30-2009, 07:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •