Exception in thread "AWT-EventQueue-0"

Hi,

I am making a very small executable jar file with only one class file in it.

After making it(with the command line: jar cvfm AndreGradsFormelen.jar Manifest.txt AndreVindu.class), I execute it with the command: java -jar AndreGradsFormelen.jar.

The window appears on the screen, but when i press the button on it, nothing happens, and this error message appears in the command thing(my source code is called Andre2.java by the way):

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Andre2

at AndreVindu.textSet(Andre2.java:159)

at AndreVindu.actionPerformed(Andre2.java:172)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

(and so on...)

(and so on...)

(and so on...)

(and so on...)

My manifest file looks like this:

Manifest-Version: 2.0

Created-By: 1.2 (Sun Microsystems Inc.)

Main-Class: AndreVindu

Name: java/AndreVindu

Specification-Title: CrazySnake Corp.| AndreGradsFormelen

Implementation-Title: CrazySnake Corp.| AndreGradsFormelen

Specification-Vendor: Gunnar Vartdal

Specification-Version: 0.1

Implementation-Version: 0.0.1

Implementation-Vendor: Gunnar Vartdal

And when i run my "un-jared" class file from the command thing with the command: java AndreVinduit works perfectly fine.

I have also tried the same on two other similar programs, and they both have similar errors. they work fine until i press a button.

Whats wrong?

[1625 byte] By [CrazySnakea] at [2007-10-2 3:57:23]
# 1

What are you doing here? Explain better about how you start the app.

"The window appears on the screen, but when i press the button on it,"

What window? What button? what "it"?

Try adding the Main-Class: attribute to the manifest file.

Try adding the Class-Path: attribute to the manifest file.

When you start a jar'ed application with java -jar or by clicking the jar in Windows, the jar's manifest file is the only source of classpath information. And if you don't specify the class name at startup, you need the main class attribute.

ChuckBinga at 2007-7-15 23:18:56 > top of Java-index,Desktop,Deploying...
# 2

Sorry.

The window= The JFrame i made.

The Button= The JButton I placed onto the JFrame, together with 5 JTextFields and 7 JLabels.

It=the "window".

When I execute the .jar file, my "window" comes to life, but when I press the button I placed on it, nothing happens (see the error above...).

When I execute my .class file(not jared version) the button "does what it's supposed to".

Hope this helped...

CrazySnakea at 2007-7-15 23:18:56 > top of Java-index,Desktop,Deploying...
# 3
Then try what I suggested.
ChuckBinga at 2007-7-15 23:18:56 > top of Java-index,Desktop,Deploying...
# 4

I figured it out myself!!

Sorry for wasting your time chuck.....

It didn't work having two different classes in the same .class file. If you understand?

In my source file I had two different classes, I cut one out and pasted it in another document, so that i now had two different source files. I compiled them, then jared them, and it worked.

I'm sorry if nothing of this made sense, but that's me =p.

CrazySnakea at 2007-7-15 23:18:56 > top of Java-index,Desktop,Deploying...
# 5
Thank you
jairama at 2007-7-15 23:18:56 > top of Java-index,Desktop,Deploying...
# 6

Can you please tell me how to solve this issue: I am also getting the same type of error when running the jar. The OracleConnectionPoolDataSource is present in the lib folder of my eclipse workspace. This is present in classes12.zip from oracle site. But i've renamed it as classes12.jar. Added this to the system classpath also. In the ant build script also i've included this using

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: oracle/jd

bc/pool/OracleConnectionPoolDataSource

at com.ecpix.sql.DatabaseConnections.<init>(DatabaseConnections.java:37)

at com.ecpix.mediacontroller.util.DBInteractor.establishConnection(DBInt

eractor.java:110)

at com.ecpix.mediacontroller.util.DBInteractor.getConnection(DBInteracto

r.java:103)

at com.ecpix.mediacontroller.util.DBInteractor.executeQuery(DBInteractor

.java:64)

at com.ecpix.mediacontroller.util.MediaControllerBean.setDBDateFormat(Me

diaControllerBean.java:144)

at com.ecpix.mediacontroller.ui.MediaManagerScreen_Search.instance(Media

ManagerScreen_Search.java:92)

at com.ecpix.mediacontroller.ui.MediaManagerScreen_Main.actionBtnControl

ler_MouseClicked(MediaManagerScreen_Main.java:206)

at com.ecpix.mediacontroller.ui.MediaManagerScreen_Main_BtnController_Ad

aptor.mouseClicked(MediaManagerScreen_Main.java:269)

at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

JoyPappya at 2007-7-15 23:18:56 > top of Java-index,Desktop,Deploying...