Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making a class executable.

 
Jon Go
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi how do you make a class exutable?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean as in HelloWorld.exe? You don't without some expensive software. The ideal way to execute a java class or set of classes is using JAR files. On a Windows system you can execute a JAR file by double clicking on the file. Or you can write a batch file/shell script that executes the JAR file or Class file is you prefer. Here is a link on how to create JAR files. Good luck!!
http://java.sun.com/docs/books/tutorial/jar/index.html
 
Jon Go
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you go about the shell-script thing that you mentioned, and also how do you add an icon to it so you can click on the desktop and it will execute.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic