Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run Java App created in Netbeans 4.1 IDE

 
David Dunmore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Charles Ditzel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Dunmore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks Layne, just what I needed!

 
David Dunmore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic