Skip to main content



      Home
Home » Newcomers » Newcomers » Build and deploy
Build and deploy [message #245398] Sun, 13 January 2008 13:05 Go to next message
Eclipse UserFriend
Originally posted by: bashiro.myway.com

Hello folks I am coming from netbeans and need help. I have searched but
cannot find an answer
My question is; I am packaging an application (a jar file) but when I
click on export, eclipse does not include the external libraries. So I get
exceptions when running this jar file outside eclipse. Could someone try
to point to m a simple way to correct this error. Thanks in advance bashiro
Re: Build and deploy [message #245403 is a reply to message #245398] Sun, 13 January 2008 13:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Bashiro,

Are they mentioned in the bin.includes of your project's
build.properties file?


bashiro wrote:
> Hello folks I am coming from netbeans and need help. I have searched
> but cannot find an answer
> My question is; I am packaging an application (a jar file) but when I
> click on export, eclipse does not include the external libraries. So I
> get exceptions when running this jar file outside eclipse. Could
> someone try to point to m a simple way to correct this error. Thanks
> in advance bashiro
>
Re: Build and deploy [message #245407 is a reply to message #245403] Sun, 13 January 2008 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bashiro.myway.com

In the Java build path (in project properties); I hvae specified the files
to be added in both the libraries and the order and export. But yet
nothing happens.

Do I necessarily need to add ant builder to o? Because I have only java
builder in the builders directory.

Thanks for any help
bashiro
Re: Build and deploy [message #245411 is a reply to message #245407] Sun, 13 January 2008 14:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Bashiro,

When you say "external libraries" you mean ones that are physically
located elsewhere? It's only going to export what's physically nested
in your project. What are you expecting will happen other than that a
jar is produced that you must put on a classpath in addition to any
other external dependencies it might have?


bashiro wrote:
> In the Java build path (in project properties); I hvae specified the
> files to be added in both the libraries and the order and export. But
> yet nothing happens.
>
> Do I necessarily need to add ant builder to o? Because I have only
> java builder in the builders directory.
>
> Thanks for any help
> bashiro
>
Re: Build and deploy [message #245451 is a reply to message #245411] Mon, 14 January 2008 01:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bashiro.myway.com

When you say "external libraries" you mean ones that are physically
located elsewhere?
yes! but this libraries (a jar file) has been added to the project and is
being used in the developement.


It's only going to export what's physically nested in your project.
What is your point/answer? do you mean this external jar file must be
located in the project directory before I add it to the libraries as jar
file and then compie before export ? I did this and does not work any
ideas ?

Thanks for any help
bashiro
Re: Build and deploy [message #245494 is a reply to message #245451] Mon, 14 January 2008 07:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Bashiro,

I know Eclipse applications can handle nested jars in in the project and
include them on the bundles classpath (in the manifest) and that in that
case there needs to be build.properties file to specify what goes in the
final binary exported result. But I don't know if any of that's
supported for a pure Java project. It seems to me that for a pure Java
project, it will take whatever has been generated into the "bin" folder
and stuff it into a jar. So if you have other jars, those jars along
with the jar you've generated all need to be added to the classpath to
run your application. Did you choose "Export->Java->Runnable Jar"?
That's more likely to do what you want...


bashiro wrote:
> When you say "external libraries" you mean ones that are physically
> located elsewhere? yes! but this libraries (a jar file) has been added
> to the project and is being used in the developement.
>
> It's only going to export what's physically nested in your project.
> What is your point/answer? do you mean this external jar file must be
> located in the project directory before I add it to the libraries as
> jar file and then compie before export ? I did this and does not work
> any ideas ?
>
> Thanks for any help
> bashiro
>
Re: Build and deploy [message #245531 is a reply to message #245398] Mon, 14 January 2008 12:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

bashiro wrote:
> Hello folks I am coming from netbeans and need help. I have searched but
> cannot find an answer
> My question is; I am packaging an application (a jar file) but when I
> click on export, eclipse does not include the external libraries. So I
> get exceptions when running this jar file outside eclipse. Could someone
> try to point to m a simple way to correct this error. Thanks in advance

Exporting a JAR does not include the JARs that the project depends on.
In Java, a JAR can not include other JARs (well, it can contain them but
they can not be included on the classpath). The usual way to run an app
that needs multiple JARs is to write a command shell script (batch file
on Windows) that sets up the classpath and invokes the correct java
executable with parameters.
Some people might recommend a plugin called "fatjar" that will
automatically bundle everything up into one "fat" JAR, but I usually
recommend against that because it makes a HUGE JAR, isn't always 100%
complete, and might violate the licenses of some libraries to re-package
them in that way.

Hope this helps,
Eric
Re: Build and deploy [message #245546 is a reply to message #245531] Mon, 14 January 2008 13:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bashiro.myway.com

This is really strange for me. I actually use netbeans. And under netbeans
when one wanted to package files, you tell it to "build". Netbeans then
send your jar file to a folder called dist/ and then automatically
put/send all the jar files / dependences (in the project) to another
folder dist/lib. So I thought eclipse does the same or similar.
I actually wanted to migrate to eclipse because i found out that working
in jbuilder (on eclipse) under GUI is more comfortable than working under
netbeans GUI.

But my question is that; is there no any build program that can do this
beside "fat jar" ? If no then I gues I have to learn ant and see if that
will help.

Thanks for the help
bashiro
Re: Build and deploy [message #245704 is a reply to message #245546] Wed, 16 January 2008 10:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

bashiro wrote:
> This is really strange for me. I actually use netbeans. And under
> netbeans when one wanted to package files, you tell it to "build".
> Netbeans then send your jar file to a folder called dist/ and then
> automatically put/send all the jar files / dependences (in the project)
> to another folder dist/lib. So I thought eclipse does the same or
> similar. I actually wanted to migrate to eclipse because i found out
> that working in jbuilder (on eclipse) under GUI is more comfortable than
> working under netbeans GUI.
>
> But my question is that; is there no any build program that can do this
> beside "fat jar" ? If no then I gues I have to learn ant and see if that
> will help.

Ant would help, definitely. hat is what it was designed for, executing
"complex" builds.
I'm curious about your description of NetBeans: if it exported your JAR
to dist/ and the other JARs to dist/lib, how did you then execute your
application?

Eric
Re: Build and deploy [message #246055 is a reply to message #245704] Sun, 20 January 2008 15:52 Go to previous message
Eclipse UserFriend
Originally posted by: bashiro.myway.com

sorry for being away for a while. Yes you execute them by double clicking
on it
in windows and of course java -jar in unix/lin platforms and it works
fine.
As I said I do not like working with gui in netbeans. Thats why I want to
try eclipse. So I will have to learn ant.
Thanks a lot
bashiro
Previous Topic:path for project must have only one segment
Next Topic:error message
Goto Forum:
  


Current Time: Mon May 12 17:14:05 EDT 2025

Powered by FUDForum. Page generated in 0.08903 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top