Results 1 to 12 of 12
  1. #1
    Zuty's Avatar
    Zuty is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default Huge Newbie Question: save so others can use

    Hi,

    I just finished working on my program in jGrasp and was wondering how do I save it as a file where other people can open it without needing jGrasp?

    Thanks,

    ~Zuty

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    Good question.
    The same question applies to other IDEs.

  3. #3
    Zuty's Avatar
    Zuty is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    Good question.
    The same question applies to other IDEs.
    Again, huge newbie. I don't know what an IDE is; I just want it so I can send a file to someone and it launches the program I made.

    ~Zuty

  4. #4
    JDScoot is offline Member
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    24
    Rep Power
    0

    Default

    For that you would need to create a .jar file containing the compiled .class program files. You will also need to include a manifest file to tell the JVM which class contains the main() method so it knows which class to call first.

    If you want whomever you are sending it to to be able to edit your code you may need to just send them the source .java files by browsing to the project directory on your hard drive.

    Lastly, IDE stands for Integrated Development Environment. JGrasp as well as Eclipse, NetBeans and many others are IDE's.
    Last edited by JDScoot; 06-16-2011 at 01:33 AM. Reason: mixed up .java and .class files

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    Read the documentation for the jGrasp program or find a forum for that program and ask there how to create an executable jar file from your java program.

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    You're question is getting at how you deploy your application.

    This is one of the areas where an IDE (any IDE) tends to keep the messy details away from you. Which is fine if you know what is happening (and want to be spared the messy details) but leaves you shortchanged and still a new a newbie if you don't know what is happening (and need to be immersed in those same messy details). If you are using JGrasp as part of some structured course then your teacher should have described what a .jar archive is, how its component parts are used at runtime and how you make the things.

    I've never used JGrasp, but Google reveals this from a tutorial: 7 Projects. How to make a .jar archive is covered in subsection 7.5 and is quite simple. That whole Tutorial seems relatively brief and may be worth reading. They don't seem to mention it, but on a Windows system the "other person" double clicks on the .jar file you create and give to them.

    For a general overview but with quite comprehensive coverage Oracle's Tutorial has a section on deployment. It might be a bit daunting at first, but it's there for reference.

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    Quote Originally Posted by JDScoot View Post
    For that you would need to create a .jar file containing the compiled .class program files. You will also need to include a manifest file to tell the JVM which class contains the main() method so it knows which class to call first.

    If you want whomever you are sending it to to be able to edit your code you may need to just send them the source .java files by browsing to the project directory on your hard drive.
    Swapped 'em now is fixed.

  8. #8
    JDScoot is offline Member
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    24
    Rep Power
    0

    Default

    Thanks for catching that Junky. I'll go back and edit my post so there is no confusion.

    forum posting + forgotten meeting reminder = hasty post.

    EDIT: Post fixed.

  9. #9
    Zuty's Avatar
    Zuty is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default

    Thank you to all of you. I am currently not taking classes, but when I was my professor was an idiot and basically told us to Google anything we didn't understand.

    ~Zuty

  10. #10
    yellowledbet is offline Senior Member
    Join Date
    Feb 2011
    Location
    Georgia, USA
    Posts
    122
    Rep Power
    0

    Default

    Quote Originally Posted by Zuty View Post
    Thank you to all of you. I am currently not taking classes, but when I was my professor was an idiot and basically told us to Google anything we didn't understand.

    ~Zuty
    learning to use Google and read documentation is a powerful skill. You may thank him one day

  11. #11
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    Quote Originally Posted by Zuty View Post
    Thank you to all of you. I am currently not taking classes, but when I was my professor was an idiot and basically told us to Google anything we didn't understand.

    ~Zuty
    Yep and you will get the same response here most times. Teach a man to fish.....

  12. #12
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    Teach a man to fish...
    I agree. But then I have to add that the rivers and oceans are polluted these days. "A pot a-cook, but d' food no 'nough".

    Whenever I'm playing with a new (to me) technology I'm amazed at how many typos I make. And any instructions I find on the internet are similarly plauged with typos or full of assumptions and cryptic jargon that would be more at home in an alchemy text. (I rapidly confirm the Chinese proverb - "a hungry man is an angry man" - that Bob picked up on.) Of course there's no devilsh magic involved, it's just that I correct my typos without thinking about it in contexts where I know what I'm doing. And I can think (and google) straight, but only when I'm comfortable and know what's going on.

    It's the recognition of this that makes me post here. "Forget your troubles and dance!"

    @OP: So, was the JGrasp tutorial useful in showing how to create a jar? And did the jar file section of Oracle's Deployment tutorial explain what's needed in a jar file and how it's used at runtime?

Similar Threads

  1. Another basic newbie question..
    By erikjd21 in forum New To Java
    Replies: 5
    Last Post: 04-12-2011, 07:38 AM
  2. Probably a newbie question.... :P
    By gblax123 in forum New To Java
    Replies: 9
    Last Post: 02-23-2011, 10:21 PM
  3. Newbie question
    By MrNiceGuy in forum New To Java
    Replies: 8
    Last Post: 11-12-2010, 05:29 AM
  4. Newbie design question
    By PrinceSendai in forum JDBC
    Replies: 1
    Last Post: 08-17-2010, 06:42 AM
  5. newbie question
    By ronguilmet in forum New To Java
    Replies: 2
    Last Post: 11-16-2009, 02:37 AM

Posting Permissions

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