Skip to main content



      Home
Home » Newcomers » Newcomers » How to create a standalone app?
How to create a standalone app? [message #102881] Mon, 19 September 2005 07:31 Go to next message
Eclipse UserFriend
Originally posted by: leo_zen.gmx.at

I have written my first app in Eclipse and now have the problem, not
knowing how to export it as standalone java-app.

What I've done:

Export => select the path 'src' with everything in it, selected 'export
generated class files and resources', specified a destination, selected to
generate a new Manifest and specify the main-entry point. Click on
'Finish' and I receive 'JAR creation failed with a list of 'Warnings'.

When I try to launch the app with

java -jar test.jar

I get an exception,

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Logger

And here I don't know, where to define the missing files. Startup via
Eclipse works without any kind of problem.

Anybody an idea what's missing?
Re: How to create a standalone app? [message #102911 is a reply to message #102881] Mon, 19 September 2005 08:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manahan.NOSPAM.ca.ibm.com

LeO wrote:
> I have written my first app in Eclipse and now have the problem, not
> knowing how to export it as standalone java-app.
> What I've done:
>
> Export => select the path 'src' with everything in it, selected 'export
> generated class files and resources', specified a destination, selected
> to generate a new Manifest and specify the main-entry point. Click on
> 'Finish' and I receive 'JAR creation failed with a list of 'Warnings'.
>
> When I try to launch the app with
>
> java -jar test.jar
>
> I get an exception,
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/log4j/Logger
>
> And here I don't know, where to define the missing files. Startup via
> Eclipse works without any kind of problem.
> Anybody an idea what's missing?
>

The jars your application depends on are probably missing from the
classpath.
Here is some information on the classpath and various ways to set it for
your application.

http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpa th.html

There are some good tutorials if you are new to java on java.sun.com.

Peter
Re: How to create a standalone app? [message #102924 is a reply to message #102911] Mon, 19 September 2005 09:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: leo_zen.gmx.at

> The jars your application depends on are probably missing from the
> classpath.

I highly assumend that the export of Eclipse does this. i.e. include the
Classpath into the Manifest, resp. provide a fully functional export to
one dir.

so, I have in my project 'external' jars, which are included in my project
build path. execution via Eclipse works fine. but for the standalone, I
have to take care by myself?

additionally not very clear for me, how to set them. should I include them
as well into my jar-file, or keep them separte?
Re: How to create a standalone app? [message #102950 is a reply to message #102924] Mon, 19 September 2005 09:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <df9a51c91e973cb630f6d77048f51f49$1@www.eclipse.org>,
leo_zen@gmx.at says...
> > The jars your application depends on are probably missing from the
> > classpath.
>
> I highly assumend that the export of Eclipse does this. i.e. include the
> Classpath into the Manifest, resp. provide a fully functional export to
> one dir.
>
> so, I have in my project 'external' jars, which are included in my project
> build path. execution via Eclipse works fine. but for the standalone, I
> have to take care by myself?
>
> additionally not very clear for me, how to set them. should I include them
> as well into my jar-file, or keep them separte?

You can't put jars within jars, so you need to have them either in the
same folder, or on the classpath.


--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: How to create a standalone app? [message #102970 is a reply to message #102950] Mon, 19 September 2005 09:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: leo_zen.gmx.at

OK, so in the same folder! So, I've put everything of the required
external jars into the same folder as the created jar from my source code.
start again with

java -jar test.jar

=> same error

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Logger


????
Re: How to create a standalone app? [message #103039 is a reply to message #102970] Mon, 19 September 2005 12:28 Go to previous message
Eclipse UserFriend
Originally posted by: leo_zen.gmx.at

I found a solution to add it into the Manifest and keep it in the same dir.
Previous Topic:How to get the system env variables in eclipse?
Next Topic:pathes for a standalone-app
Goto Forum:
  


Current Time: Thu May 29 02:05:00 EDT 2025

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

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

Back to the top