944,083 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 21914
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 11th, 2005
0

how do i make executable

Expand Post »
hello,

I am using netbeans and i wonder how you make a executalbe so you can drag and drop it into a floppy then run the prog on someone else's computer.

Is it call making a jar file or sommthing. ANy help is this simple or wat?

God bless.
Similar Threads
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Nov 11th, 2005
0

Re: how do i make executable

You can't, period.

There are some tools that will create exe-wrappers but they effectively just pack an entire JVM in with the classfiles.

Create an executable Jar instead, that can then be run on any computer that has a JVM installed by either double clicking on it (if the machine is so configured) or by using the java -jar <somejar.jar> command.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Nov 12th, 2005
0

Re: how do i make executable

Quote ...
Originally quoted by jwenting

Create an executable Jar instead, that can then be run on any computer that has a JVM installed by either double clicking on it
Ok, so how do u do this in netbeans? I got to here but what do i do. My program creates a window with hello world in it. I can't get it to work. This is i got so far
Attached Thumbnails
Click image for larger version

Name:	stuff.JPG
Views:	297
Size:	33.1 KB
ID:	1531  
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Nov 13th, 2005
0

Re: how do i make executable

Don't know how to do it from Netbeans. Should be mentioned in the documentation somewhere if it's possible.
If not check the JDK documentation for the jar command which tells you how to do it by hand (which you should learn to do anyway, you won't always have netbeans available).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Nov 13th, 2005
0

Re: how do i make executable

You could create a batch file (.bat). This answer is for Windows computers. It is not an executable but it is very simple to make.

Suppose you main method is in the class MyTest. Then create a file called MyJavaRun.bat. (The name is arbitrary)

Inside the file write:

Java Syntax (Toggle Plain Text)
  1. java MyTest
  2. pause
The first line runs the JVM giving it the main class and the second command prevents the window from closing all of a sudden when the program exits.

Then just double click the .bat file and it will run the Java program.

For more help, www.NeedProgrammingHelp.com
NPH
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
NPH is offline Offline
55 posts
since May 2005
Nov 14th, 2005
0

Re: how do i make executable

I still cannot do thuis. I follow the instructions but I create a java.content file. not a jar executealbe file? Why is this so hard. Surely someone has netbeans and has created a jar file.



:cry:

I'm trying to keep this as simple as poss... using sams teach meself java 2 in 24 minutes.

Java Syntax (Toggle Plain Text)
  1. import javax.swing.*;
  2.  
  3. public class SalutonFrame extends JFrame {
  4. public SalutonFrame()
  5. {
  6. super ("Salut la monde");
  7. setSize(350,100);
  8. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  9. setVisible(true);
  10. }
  11. public static void main(String[] args)
  12. {
  13. SalutonFrame sal = new SalutonFrame();
  14. }
  15. }

I have create a folder wit two files. one with SalutonFrame.java and one with the class properties.

How do i manifest, is tat the word, this folder and create a jar executalbe in NETBEANS

god bless
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Nov 14th, 2005
0

Re: how do i make executable

Do you know how to create one via the commandline?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Nov 14th, 2005
0

Re: how do i make executable

Quote ...
Originally quoted by server_crash

Do you know how to create one via the commandline?
No, can you show me. I just assumed it would be easier in netbeans,since it is uses a point and click interface, but I'm having noo luck.

You will have to explain it step by step. Like how to set the command prompt to the right directory. And stuff. I is very stupid. sorrie



If this works I owe you one
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Nov 14th, 2005
0

Re: how do i make executable

Hi everyone,

Quote originally posted by iamthwee ...
can you show me
Read the below thread carefully. There are links there that teach you specifically how to make an executable jar step by step

Here is the link

http://www.wizardsolutionsusa.com/fo...read.php?t=100

Yours Sincerely

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Nov 14th, 2005
0

Re: how do i make executable

He doesn't even know how to compile his sources... Read carefully.

Another victim of the IDE. Learns the tool, not the language, and gets stuck when there's no nice shiny "run" button for something.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: creating a Trie
Next Thread in Java Forum Timeline: about static variable





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC