This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a java application that is started from an executable. When I try to run that, This error pops up "Title: Java Virtual Machine Launcher" saying "Could not find the main class. Program will exit."
This error is coming when the application is tried to run on some machines (that's what I think), and not for all the users. Following are the steps that have been suggested, but the error still persists:
1.Uninstall any older/ multiple versions of java from the Windows machine and keep only the latest one.
2.Point the environment variable "CLASSPATH" to the directory where "java" is present, and also to the main class of my application.
3.Try installing the tool on a different machine (in the same network domain).
I have seen many posts in this and other forums on this topic, and the solutions suggested above have been taken from them, but the solution for my problem here is not there. It may be a trivial mistake or something else, but please help me out, as I am only a beginner in trying to solve such problems.
Also, if you can please tell me how do I get this error, on my machine, that would be great? Something to understand the steps causing the problem. I don't get the error pop-up on my system.
Any suggestions about setting a CLASSPATH are likely to be unhelpful. In fact a system CLASSPATH can do more harm than good. The sort of error you quote suggests you have nothing wrong with the Java™ installation, but there is a problem with your own file.
You are not clear about what you are running. Are you running a .jar or a .exe? If a .jar, what is in its manifest file? Please print that out. What is the fully-qualified name of the class with the main mathod in?
Joined: Feb 03, 2011
I am trying to run a ".exe". And the main class called from the exe is present in a .zip file. The contents of the zip are shown below. The main class is "pkgLib.ProgABDriver".
I recently encountered the same error while using Eclipse. Turns out I changed the default version of the JRE instead of just the version for a specific project. This leads me to believe your error may be as a result of the Java version on some machines that are incompatible with the compiled version of the .jar file.
In Eclipse, I could resolve this issue by changing the JRE version referred in my runtime libraries. Not sure how you'd fix this for a standalone program, but hope this helped.