aspose file tools*
The moose likes Beginning Java and the fly likes How to run Java App created in Netbeans 4.1 IDE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to run Java App created in Netbeans 4.1 IDE" Watch "How to run Java App created in Netbeans 4.1 IDE" New topic
Author

How to run Java App created in Netbeans 4.1 IDE

David Dunmore
Greenhorn

Joined: Jan 14, 2006
Posts: 5
Hi,
a ew years ago, I did quite a bit of Java App development, using an editor, and compiling/running on a command line via JAVAC Myapp/Java Myapp.

I've just installed J2SE5 and Netbeans 4.1 IDE. I like the IDE, but how do I run the resulting .class file(s) as a free-standing application, and what packaging (if any) would I need to make a distributable App.



All advice gratefully received


David (The more you do, the more you CAN do)
Charles Ditzel
Greenhorn

Joined: Jan 03, 2006
Posts: 2
The best place to find information on NetBeans IDE 4.1 and 5.0 RC1 is at NetBeans.org. The documentation location is here. Recently, NetBeans.org released NetBeans 5.0 RC1 (release candidate) and it includes a very powerful UI builder which may or may not be of interest to you. You can find a nice tutorial on it here.

You can find a complete tutorial on using NetBeans IDE 4.1 here..

Hopefully this is of use to you.
Charles
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
To create a "stand alone application", you need to tell NetBeans to build a JAR file. I am not on my own computer at the moment so I can't verify the following instructions. I hope it is close enough to give you the right idea.

1) Right click on the project name on the left
2) Find the menu item that says something like "Run an Ant target"
3) Select the "jar" or "build-jar" target

The executable JAR file will be in the dist subdirectory under your project's main directory. I'm sorry if these instructions are not completely accurate. I hope they are close enough to put you on the right track.

As for distribution, you will need to include the JRE with your JAR file. Either you can provide the whole software package or a link with instructions how to download it.

I hope this helps.

Regards,

Layne


Java API Documentation
The Java Tutorial
David Dunmore
Greenhorn

Joined: Jan 14, 2006
Posts: 5
Many thanks Layne, just what I needed!

David Dunmore
Greenhorn

Joined: Jan 14, 2006
Posts: 5
Almost there, I get a .jar file in the dist sudirectory OK, but when I try to run it, I get the following message from the JVM
'Failed to load the Main-Class manifest from C:\....\Myapp.jar'

I'm obviously mising something here...but what?

To save me posting many questions here, can you recomment a book that will cover these sort of things?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to run Java App created in Netbeans 4.1 IDE