I'm a freshman in college and currently taking Java Programming. I have an inside joke among my group of friends that one of them has a hard time making his own opinions. I want to write a program that, when run, based on a random number generator, gives him an opinion. I have no problems figuring that part out. But, how can I get him to run the program easily? I feel like it would be too much work for him to install jGrasp (my coding software) and teach him how to compile and run etc. Is there some sort of basic program that just runs the code? As you can probably tell, I don't know that much about programming yet. I have looked for what I'm asking but couldn't find anything that wasn't just a replacement for jGrasp.
2 Answers
One way to do this is to write your program in Eclipse. Maybe this is possible in jGrasp, but I am more familiar with Eclipse.
In Eclipse, just create a new project and write your program. Then in the package explorer on the left, select your project and right click it. Select Export, you wil see the following dialog:
Choose "Runnable JAR File" under "Java". Press Next. You see something like this:
Choose a project to export (launch configuration) and a destination of the export. Then just select what I selected.
And then press "Finish" and your are done!
Now go to the directory you chose and run the jar file!

- 213,210
- 22
- 193
- 313
Does your program compile into a class/executable? If so, install the newest version of java on your friend's computer, send him the class, and you could just run it through the Windows Command Prompt by running:
cd location/of/file
java classname
If you're on Mac or Linux, just go to Bash or Terminal and run the same thing.
Download Java from https://java.com/en/download/.

- 4,339
- 11
- 26
- 35