This discussion is archived
3 Replies Latest reply: Jun 5, 2011 2:14 AM by Kayaman RSS

archiving a java application into jar file

799561 Newbie
Currently Being Moderated
hello, I have a java application and I want to archive it into jar executable file. in the manifest file there is classpath attribute for designing all jar file required by the application but there is no attribute for designing sourcepath required ( for example my application use swing components like JFrame,JButton,...) and I have exported the jdk into the application directorie, so my application use this jdk (depend on this jdk). the question which I looking for a responce is how the java tool determine that swing components used in the application reside into the exported jdk (jdk\src).
  • 1. Re: archiving a java application into jar file
    Kayaman Guru
    Currently Being Moderated
    boulebtina wrote:
    designing sourcepath required ( for example my application use swing components like JFrame,JButton,...)
    Sourcepath? Swing doesn't require anything special to work.
    and I have exported the jdk into the application directorie, so my application use this jdk (depend on this jdk).
    What's so special about this jdk that you need to rely on it? Why not use the one that the user has installed?
    the question which I looking for a responce is how the java tool determine that swing components used in the application reside into the exported jdk (jdk\src).
    I think you have some form of misunderstanding here.
  • 2. Re: archiving a java application into jar file
    799561 Newbie
    Currently Being Moderated
    I have exported jdk to make my application depend on this jdk so any pc have no jdk can execute my application.
  • 3. Re: archiving a java application into jar file
    Kayaman Guru
    Currently Being Moderated
    boulebtina wrote:
    I have exported jdk to make my application depend on this jdk so any pc have no jdk can execute my application.
    Well, first of all, that's quite useless, since most of the computers do have Java installed (and you don't need the JDK, you need a JRE for executing). This was a more serious issue back in 2000-2005 (approximately), but I personally wouldn't bother with this in 2011.

    Secondly, let's assume that you have a real reason for this. You would be crazy to try to roll your own solution for this, since there exists several products for wrapping a JRE and your own program together.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points