How to create executable jar in NetBeans IDE

S

semi

I used to use Jbuilder for JAVA development. In Jbuilder, I was able
to create executabe jar that has all the libraries in and run on its
own. How do you create same kind of executable jar with NetBeans?

Thanks in advance,

Seung
 
K

Karel Suikers

I used to use Jbuilder for JAVA development. In Jbuilder, I was able
to create executabe jar that has all the libraries in and run on its
own. How do you create same kind of executable jar with NetBeans?

I do it with an ant script. I hope someone can tell me how to do it with
three mouseclicks...
 
O

Oscar kind

Karel Suikers said:
I do it with an ant script. I hope someone can tell me how to do it with
three mouseclicks...

In my IDE, I use two mouse clicks (sorry, not three). These mouse clicks
start ANT using a similar build script.

Many IDE's provide ANT support these days, of which JBuilder is one
(IIRC). I know for certain that Eclipse and IntelliJ do.
 
F

Ferenc Hechler

Oscar kind said:
In my IDE, I use two mouse clicks (sorry, not three). These mouse clicks
start ANT using a similar build script.

Many IDE's provide ANT support these days, of which JBuilder is one
(IIRC). I know for certain that Eclipse and IntelliJ do.

In Eclipse you can use the Fat-Jar Eclipse Plug-In
http://fjep.sourceforge.net .
This plugin allows building an executable jar file containing all referenced
jars,
classes and subproject. The information is gathered from the project
classpath.
After you have configured and saved the settings for a project (Main-Class.
....),
you can rebuild the "Fat-Jar" with one mouse-click: Right-Click on the
settings -> Fat-Jar -> Quick-Build :)
Also you can export the current settings as an ANT script.

Best regards,

feri
 
Joined
Dec 20, 2007
Messages
1
Reaction score
0
Netbeans!

Why use a Eclipse if you can use a well-suited, fast and optimized out-of-the-box-IDE?
Easy as pie: (Netbeans 5.5)

right-click your project,
"set main project",
select your project,
"File",
"PROJECTNAME Properties",
"Run",
set your main class,
"Libraries",
"Add JAR/Folder",
select your wanted libs,
do a CLEAN build,
enter the build-path,
enter /dist and be amazed --> DONE!

No Modifications/Hacks/buggy DiY-IDE´s, no cry :flute:
 
Joined
Dec 14, 2011
Messages
1
Reaction score
0
Why use a Eclipse if you can use a well-suited, fast and optimized out-of-the-box-IDE?
Easy as pie: (Netbeans 5.5)

right-click your project,
"set main project",
select your project,
"File",
"PROJECTNAME Properties",
"Run",
set your main class,
"Libraries",
"Add JAR/Folder",
select your wanted libs,
do a CLEAN build,
enter the build-path,
enter /dist and be amazed --> DONE!

No Modifications/Hacks/buggy DiY-IDE´s, no cry :flute:


Hi, this sounded so good. I have had so much trouble with this. I just can't seem to get my jar file runnable. I have followed you steps, I do my clean and build, but when I try to run it from the dist folder is still doesn't work..! I think I might not add the right "libs".. what do you mean exactly by this? Sorry, I am very new to Java and netbeans...!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top