473,503 Members | 5,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jar files execution failure

40 New Member
I create jar files like that:
Expand|Select|Wrap|Line Numbers
  1. jar -cvmf manifest.txt app1.jar *.class
I run them like that:
Expand|Select|Wrap|Line Numbers
  1. java -jar app1.jar
Ok so far. My program is up and running.

When I try to run the same jar files with double click ( in Win XP I associate them with java.exe) I get an error, Exception in thread main...no class found.

What am I doing wrong?

Thanks
stack
Sep 27 '07 #1
3 1984
Nepomuk
3,112 Recognized Expert Specialist
I create jar files like that:
Expand|Select|Wrap|Line Numbers
  1. jar -cvmf manifest.txt app1.jar *.class
I run them like that:
Expand|Select|Wrap|Line Numbers
  1. java -jar app1.jar
Ok so far. My program is up and running.

When I try to run the same jar files with double click ( in Win XP I associate them with java.exe) I get an error, Exception in thread main...no class found.

What am I doing wrong?

Thanks
stack
Probably Windows isn't adding the "-jar" argument and therefore it can't find any of your classes - especially not the class containing the main method.

To set it that way, open the place, where you associated JAR files with java.exe and click on "More" (or whatever the button may be called). If there's an Operation called "open", edit that, otherwise create a new one called "open". It should have the following value:
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files\Java\jre1.6.0_02\bin\java.exe" -jar "%1" %*
Of course, you'll have to change the Path according to where java.exe lies.

Greetings,
Nepomuk
Sep 27 '07 #2
stack
40 New Member
Probably Windows isn't adding the "-jar" argument and therefore it can't find any of your classes - especially not the class containing the main method.

To set it that way, open the place, where you associated JAR files with java.exe and click on "More" (or whatever the button may be called). If there's an Operation called "open", edit that, otherwise create a new one called "open". It should have the following value:
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files\Java\jre1.6.0_02\bin\java.exe" -jar "%1" %*
Of course, you'll have to change the Path according to where java.exe lies.

Greetings,
Nepomuk
I don't know if you can do that with XP and if you can, I don't know how it's done.
My only option when I associate files is to choose from a list of programs but I cannot set a path.
Do you know where I can set this path with win XP?

Thank you for you reply,
stack
Sep 27 '07 #3
stack
40 New Member
Ok, problem solved.

Thanks
Sep 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1811
by: August1 | last post by:
i'm having difficulties with the execution of a program, i believe due to something i am missing in the copy constructor implementation. When i create one object of the class and run the program...
7
32858
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
10
10975
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
7
2457
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7258
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.