1

Using NetBeans IDE 7.3.1, I modified a desktop application under Windows 7, using JDK 1.7. Performed clean and build, and tested this application under Windows 7, Windows XP, and on a MAC. All test scenarios run under each operating system performed as expected.

This app is ported to outside vendors, and all vendors, except for one, have loaded and executed the app without any issues.

The one vendor encountering problems, and running under Windows XP, returns an error message - "Could Not find or load main class". After doing a little research, this error usually indicates the JDK is different. They downloaded and installed JDK 1.7, but the same error message appears. I had them go to http://javatester.org/othertesters.html, making sure that java was working on the workstation and verifying the java version (1.7). They reinstalled JDK 1.7 and still receive the same error.

I have duplicated the error by removing JDK 1.7, loading JDK 1.6 and running the app. Receive error ("Could Not find main class"). A little different than what they receive, but basically the same problem. Removed JDK 1.6, loaded JDK 1.7 and problem disappears.

I'm at my wits end! I am going to make an appt. to access their workstation. But before I do, I would like to put a plan in place to try different scenarios to fix the problem. I don't know how to proceed, since I've run out of options. I'm hoping for any suggestions.

4
  • app is ported Ported how? As a jar, war, etc.? Seems to me that the classpath isn't correct. Commented Aug 15, 2013 at 14:31
  • How they stat your app? From command line? Since this is a desktop application why don't they just run java -version? Commented Aug 15, 2013 at 14:40
  • I'm fairly sure "could not find main class" gets asked and answered roughly once a day. Check the previous asked questions for how to diagnose classpath issues. Commented Aug 15, 2013 at 14:49
  • Also, you have an XY problem. Instead of describing your research into a wild goose chase (JDK version mismatch) your question should describe your problem accurately. How are you running your app, what's on the classpath, what is the exact error message, what's actually in the JARs in the classpath? Commented Aug 15, 2013 at 14:52

3 Answers 3

1

OK,

Problem solved. Sent application via outlook, modifying executable file from .jar to .txt b4 sending application. I didn't think about looking in compressed LIB directory. Four files were .jar files. These files were quarantined. Renaming these files to .txt b4 compressing app would have eliminated the problem. Resent the zip, vendor extracted and renamed all .txt files to .jar. All is well.

Appreciate everyone's input.

Sign up to request clarification or add additional context in comments.

Comments

0

I believe they still have a JDK 1.6 on their machine and use this, for some reason, to try to execute the application. I've seen this various times at customer workstations.

Very often, people are not aware of what they have installed. Tell them to remove all JDKs and JREs from their workstation, by way of uninstallers and looking into the program folder and deleting stuff manually. Tell them how to do it. Do this with them during a phone call.

Then have them reinstall JDK 1.7. I'm almost sure it will work afterwards.

Alternatively, you can compile the application for older JDKs. You can also do this using JDK 1.7 by setting the target version for the classfiles.

Comments

0

Make sure that their JAVA_HOME path is pointed towards the JDK 1.7 install. I have had similar issues where I had multiple JDKs installed, needed to use the latest, but the computer was pointing to an older version.

To find what version the java_home is type java -version in the cmd.

How to find java_home: How do I find where JDK is installed on my windows machine?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.