Results 1 to 20 of 22
- 04-04-2012, 12:05 PM #1
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
how to correct "Java Exception Occurred" in java desktop application
Hi
.gif)
i try to build an simple desktop application using jdk 1.7 by Netbeans7.01 IDE
if i run the project it run well in Netbeans and i can create jar by "clean & build" option,
the jar self also running in side it's own folder.
But!
my problem is, if is shift jar in another location it not working & show an exception in dialog box
like "Java Exception Occurred"
title as "Java Virtual Machine Launcher "
Any one can help me how to correct the exception,
i m waiting for your help friends..,
Thank you..,
- 04-04-2012, 12:13 PM #2
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
Re: how to correct "Java Exception Occurred" in java desktop application
You need to supply us with some more details on the exception message rather then just "Java Exception Occured".
Website: Learn Java by Examples
- 04-04-2012, 01:06 PM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: how to correct "Java Exception Occurred" in java desktop application
Does the dist folder containg the jar file (the one generated by Netbeans) contain anything else?
For example, other jars that yours uses.Please do not ask for code as refusal often offends.
- 04-04-2012, 02:19 PM #4
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
- 04-04-2012, 02:24 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: how to correct "Java Exception Occurred" in java desktop application
Run the jar file from the command line for starters, just to ensure it works there.
java - jar <your jar file>
If there are exceptions you'll at least see them.Please do not ask for code as refusal often offends.
- 04-04-2012, 02:28 PM #6
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
but if i create an application by choosing with netbeans "Newproject > java > javaApplication in swing".
it is working well, can create jar, i can move & run at any place in my pc,
the problem is even i unable to netbeans "Newproject > java > javaDesktopApplication"
it is also working well,
can create jar,
i can move .
But!
i con't run at any place in my pc sir,
- 04-04-2012, 02:32 PM #7
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
- 04-04-2012, 02:35 PM #8
Re: how to correct "Java Exception Occurred" in java desktop application
What happens when you do as suggested by Tolls?
Open a command prompt window, change to the directory (using the cd command) with the jar file and enter:
java -jar <JARFILENAME>.jar
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.
The error message in the image says there is a missing class. Is that class file in the jar file? Use a zip file utility to view the jar file contents.Last edited by Norm; 04-04-2012 at 02:38 PM.
If you don't understand my response, don't ignore it, ask a question.
- 04-04-2012, 02:38 PM #9
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
Ok Mr.Norm, sorry for my mistake,
i will fallow you hereafter..,
- 04-04-2012, 02:45 PM #10
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
sir!
when i extract by using zip
the MANIFEST.MF file contains
"
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.7.0_01-b08 (Oracle Corporation)
Class-Path: lib/appframework-1.0.3.jar lib/swing-worker-1.1.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: billtest.BillTestApp
"
- 04-04-2012, 02:49 PM #11
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
what i have to do with this sir..,
- 04-04-2012, 02:53 PM #12
Re: how to correct "Java Exception Occurred" in java desktop application
Where is the missing class? You need to put its definition on the classpath.
If you don't understand my response, don't ignore it, ask a question.
- 04-04-2012, 02:57 PM #13
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
can you please guide me sir,
how to do that?..,
- 04-04-2012, 02:59 PM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: how to correct "Java Exception Occurred" in java desktop application
See my first post.
Your jar file was created in a directory called 'dist'.
I asked if there was anything else in that folder, because everything in that folder is needed for your app to run.
I would bet that there's a 'lib' folder in there, containign those two jar files.Please do not ask for code as refusal often offends.
- 04-04-2012, 03:01 PM #15
Re: how to correct "Java Exception Occurred" in java desktop application
Look in all the jar files you have for the missing class file. When you find the jar file with the missing class file, add it to the classpath.
I don't know how the java program uses the Class-Path: entry in the manifest. I've only used that entry with jars files in the same folder. Your Class-Path: entry has a path. Remove the path and put the jar files in the same folder.If you don't understand my response, don't ignore it, ask a question.
- 04-04-2012, 03:22 PM #16
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
thank you sir!
their are two jar files as being in that project folder as you said..,
jest i try to in netbeans, highlight the project > right click > select project property > library > "it contains the swing application framework zip file in it"
is their any other way to i add this two jar files sir.,
- 04-04-2012, 03:25 PM #17
Re: how to correct "Java Exception Occurred" in java desktop application
Sorry, I do not know how to use your IDE.
If you don't understand my response, don't ignore it, ask a question.
- 04-04-2012, 03:35 PM #18
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Re: how to correct "Java Exception Occurred" in java desktop application
OK sir!
i am very happy with your guidance,
today i can understand the exception reason by you.,
i will try to search some internet resources..,
Thank you sir..,
Have a happy day..,
- 04-04-2012, 03:49 PM #19
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: how to correct "Java Exception Occurred" in java desktop application
The idea behind the Netbeans dist folder is that that is the folder you distribute for your app to run.
Hence the name...'dist'.
Netbeans sticks dependent jars in a lib folder in order to not confuse which jar file is the executable one.
It's a lot neater.Please do not ask for code as refusal often offends.
- 04-04-2012, 03:55 PM #20
Senior Member
- Join Date
- Jan 2012
- Location
- TamilNadu
- Posts
- 162
- Rep Power
- 2
Similar Threads
-
Got struck with this :- " Exception in thread "main" java.lang.NullPointerException"
By Vermont in forum New To JavaReplies: 5Last Post: 12-21-2011, 06:44 PM -
"CRUD"(java desktop database application) in java application posible???
By juliarjan in forum AWT / SwingReplies: 0Last Post: 11-25-2011, 06:16 AM -
Exception in thread "main" java.lang.NumberFormatException:input string: "060320
By renu in forum New To JavaReplies: 14Last Post: 04-08-2011, 06:01 PM -
"Exception in thread "Launcher:/Whiteboard" java.lang.RuntimeException: Failed to loa
By Shajith in forum EclipseReplies: 3Last Post: 03-21-2011, 01:48 PM -
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM


LinkBack URL
About LinkBacks
Reply With Quote





Bookmarks