Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

How do i get my none programmer friends to try out my simple programs by just clicking on them?

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello. So my friends are asking me to show them some of the little programs i have been developing, and i would love to just send it as an email attachment so they can just click on it and it automatically loads up. But at the moment the only way i know to run my programs is by using an IDE or the command line and if they were to use the command line i would have to explain to them about how to set the classpath and tell them to type in things like cd C:\ java.

So obviously when people write programs the user does not have to go through all that. They should be able to just click on the file and it loads up. ( I know they would need to have java on their computer though).

I have only just started learning about GUIs and am at the stage of learning to add buttons and learning about Action Listeners and such. But i've been flicking ahead though my books and i can't find any mention of how i can get others to use my programs.

So is there a way to do this? If so can you write a link to an article explaining how, or even just a term that i can search in google.

Thanks to anyone who takes the time to help.

 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
The term you want to search for is 'Executable JAR'.

A JAR is a Java ARchive, very much like a ZIP file, but with a special manifest (text file) which tells Java where the main class is. A good IDE will have a wizard for making a JAR file (or it can be done using the command line). The JAR has to contain all of the classes for the app. The user downloads the JAR, double clicks it, and the app runs (as long as they have Java properly installed). Do a quick search and you will find lots of help on how to build them.
 
Marshal
Posts: 78666
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
To add to what Steve has told you: look in the Java™ Tutorials section.
 
Neil Cartmell
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Steve Luke wrote:The term you want to search for is 'Executable JAR'.

A JAR is a Java ARchive, very much like a ZIP file, but with a special manifest (text file) which tells Java where the main class is. A good IDE will have a wizard for making a JAR file (or it can be done using the command line). The JAR has to contain all of the classes for the app. The user downloads the JAR, double clicks it, and the app runs (as long as they have Java properly installed). Do a quick search and you will find lots of help on how to build them.



Thank you! That's all i needed to know. :)
 
Neil Cartmell
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Campbell Ritchie wrote:To add to what Steve has told you: look in the Java™ Tutorials section.



Cheers i'll read that now.
 
Campbell Ritchie
Marshal
Posts: 78666
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
You're welcome
 
Neil Cartmell
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello i've been trying to make a jar file and something seems to be going wrong.

This is an article with the instructions i have been following Creating an Executable jar File
The error i'm getting when i try to run the jar file is "Could not find the main class: TurtleTest3 . Program will exit."

I have 3 classes in my program the one with the main method is called "TurtleTest3" and the other two are called "Turtle3" and "Instructions".

These are the exact steps i have taken. I am using command prompt.


echo Main-Class: TurtleTest3 >manifest.txt

(then i push enter)

jar cvfm TurtleGame.jar manifest.txt TurtleTest3.class Turtle3.class Instructions.class

(then i push enter and it displays a load of info)

TurtleGame.jar

(then it displays the error message i told you about)


Anyone know what i'm doing wrong?





 
Campbell Ritchie
Marshal
Posts: 78666
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post a new and fresh question on an old thread. Closing thread.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic