Results 1 to 19 of 19
- 05-02-2011, 09:32 AM #1
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
Could not find the main class, program will exit.
Hey when ever I try and run a .jar file it says Could not find the main class, program will exit. I was reading about the environment variables and found they thought java was in a different directory. I also tried deleting all the java registrys before reinstalling.
- 05-02-2011, 09:45 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
- 05-02-2011, 09:56 AM #3
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
Im not shore but this has happened with about 25 different jar files (all i have tried) and they work on my friends computer
- 05-02-2011, 10:07 AM #4
Member
- Join Date
- Feb 2011
- Posts
- 31
- Rep Power
- 0
open the jar file with a compression tool like winrar and see if it contains a folder "META-INF" and a file MANIFEST.MF
the file should look similar to this
Manifest-Version: 1.0
Main-Class: package.Main
if the file has a lactation to the main class try running the jar from cmd
java -jar "jarfilename.jar"
- 05-02-2011, 10:14 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
Last edited by JosAH; 05-02-2011 at 10:26 AM. Reason: Too slow again ...
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-02-2011, 10:44 AM #6
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
I extracted it and the manifest.fm said
"
Manifest-Version: 1.0
Rsrc-Class-Path: ./ substance.jar flamingo.jar trident.jar substance-f
lamingo.jar
Class-Path: .
Rsrc-Main-Class: tfcmanager.Main
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoa der
"
I have already tried through cmd/batch file and it has the same problem.
and josah the main jar im trying to use is TFCMM v1.5.jar and yes it has a Manifest entry
- 05-02-2011, 10:54 AM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
- 05-02-2011, 11:01 AM #8
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
yes i found JarRsrcLoader.class
- 05-02-2011, 11:20 AM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
- 05-02-2011, 11:49 AM #10
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
Yes in the extracted files and in that extracted folder it was org/eclipse/jdt/internal/jarinjarloader/JarRsrcLoader
- 05-02-2011, 12:18 PM #11
Member
- Join Date
- Feb 2011
- Posts
- 31
- Rep Power
- 0
If that exact jar, runs on a different pc and works as you stated previously, i cant imagine the jar is the problem. have you tried reinstalling your jre?
- 05-02-2011, 12:19 PM #12
Member
- Join Date
- Feb 2011
- Posts
- 31
- Rep Power
- 0
sorry i see you did reinstall my bad:D
- 05-02-2011, 12:24 PM #13
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
- 05-02-2011, 12:46 PM #14
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
It cant find main class but this isnt the jar i have tried alot of programs. Is it possible you could teamviewer me because it would make things faster and easier?
- 05-02-2011, 12:56 PM #15
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
Also i think it has to do something with how i use to have java 32 bit and i changed to 64bit and i read another thread and it has something to do with my environment variables
- 05-03-2011, 04:44 AM #16
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
I found out that my registry for java is all wrong and so is my environment varibles. So if anyone knows how to add them or revert to default please help?
- 05-03-2011, 06:07 PM #17
- 05-03-2011, 10:00 PM #18
Member
- Join Date
- May 2011
- Posts
- 9
- Rep Power
- 0
- 05-03-2011, 10:14 PM #19
Ah I didn't see that. Hmmm this is weird. If it works on another computer, then the JRE is definitely the problem here.
Similar Threads
-
Could not find the main class, program will exit
By grottesco in forum New To JavaReplies: 7Last Post: 11-03-2010, 06:51 AM -
Could not find main class: Jframe. Program will exit.
By egbert95 in forum New To JavaReplies: 4Last Post: 07-29-2010, 02:53 PM -
Could not find the main class, program will exit.
By aryubi in forum New To JavaReplies: 39Last Post: 02-19-2010, 10:02 AM -
Could not find the main class. Program will exit.
By XSROSSITER in forum New To JavaReplies: 0Last Post: 01-30-2010, 04:17 AM -
Could not find the main class. Program will exit.
By Carrier in forum New To JavaReplies: 1Last Post: 04-22-2009, 02:27 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks