facebook

Could not find or load main class jdk1.7

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #343401 Reply

    Dattaprasad
    Member

    Hi,

    Issue:
    Getting below error when executing simple ‘Hello World’ Java Application from Myeclipse 2013 SR2.
    Same Errors comes when running internal Tomcat server.

    Error: Could not find or load main class jdk1.7.0_40

    Environment: Windows 7, 64 bit machine
    JDK 7 installed as C:\Program Files\Java\jdk1.7.0_40

    Also machine has C:\Program Files (x86)\Java\jdk1.7.0_40 — Just for your information

    Enviroment set as:
    JAVA_HOME=C:\Program Files\Java\jdk1.7.0_40
    CLASSPATH=C:\Program Files\Java\jdk1.7.0_40\bin;.;
    PATH=C:\Program Files\Java\jdk1.7.0_40\bin;

    Also In Myeclipse:Installed JRE is set to C:\Program Files\Java\jdk1.7.0_40 JDK path.

    One Strange observation is that:
    1. While installing Myeclipse 2013 SR2 on XP it is getting installed in C:\Program Files\
    However for this machine it was installed on “C:\Users\UserName\AppData\Local\MyEclipse Professional\myeclipse.exe”
    Even installed using administrator rights. When try to change installation directory path during isntallation to program
    files, showing tool tip as restricted access.So We installed Myeclipse 2013 on
    “C:\Users\UserName\AppData\Local\MyEclipse Professional\myeclipse.exe”

    Is this problem? or There is another issue.

    Please guide the fix this issue.

    Regards,
    Dattaprasad

    #343444

    Dattaprasad,

    Sorry that you are running in to this issue with MyEclipse.

    1) Please check Tony’s comment in stackoverflow and respond to the questions here ?

    2) Also, clear the contents of the log file located at <%workspace dir%>/.metadata/.log file, replicate the issue and attach the .log file here to help us investigate further.

    #343449

    Dattaprasad
    Member

    Here are the reply to Tony’s comment:
    Regarding your problem, is that the exact error message? What type of project is it (you can’t run a Java project on Tomcat)? How are you trying to run the program? Can you add the source code for your HelloWorld program?

    Rep:
    Yes error message is ‘Error: Could not find or load main class jdk1.7.0_40’
    Actually I have jsut created Web project and in src added Test class having below simple code:

    public class Test {

    /**
    * @param args
    */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.out.println(“test”);
    }

    }

    Tried to run this as Java application.External Tomcat is starting from Tomcat configuration but from inside Myeclipse server as well as simple java application is not working.

    FYI:
    Yesterday We installed, Myeclipse 7.1 blue edition for verification,When we selected internal Myeclipse JRE as installed JRE then java application was run.
    However when we selected external JDK7 installed as JRE then program dosn’t worked.

    @support-pradeep wrote:

    Dattaprasad,

    Sorry that you are running in to this issue with MyEclipse.

    1) Please check Tony’s comment in stackoverflow and respond to the questions here ?

    2) Also, clear the contents of the log file located at <%workspace dir%>/.metadata/.log file, replicate the issue and attach the .log file here to help us investigate further.

    #343452

    Dattaprasad,

    We could not replicate the issue at our end with JDK 7.

    > There might be some problem with your JDK installation, so can you please try running the ‘Helloworld’ program outside of MyEclipse, just to check that JDK 7 is working fine ?

    > Also, please attach the .log file as mentioned in my earlier response.

    #343453

    Dattaprasad
    Member

    I have tried .class file CMD and it is working for JDK 7.

    Only unable to run from Myeclipse ide.

    attaching .log file.

    Attachments:
    You must be logged in to view attached files.
    #343461

    Brian Fernandes
    Moderator

    DattaPrasad,

    This problem looks like you have a mis-configured JRE.

    1) I believe you are running a 64bit version of MyEclipse, is that correct?

    2) The external JRE that you are trying to run with, is that a 32 or 64bit JDK? Just to avoid variability here, I would suggest using the same architecture. (You did mention it runs on the command line, but I’m not sure if this is the same JRE)

    3) Please also check the JRE that is assigned to the proejct in the package explorer.

    To reiterate, this is not a problem with MyEclipse, these cases are rather fundamental and should work fine. It will be a project or a JRE misconfiguration. To investigate further, can you please send us:

    a) Export your project as an archive using File > Export.
    b) Go to Window > Preferences > JRE and select the JRE that you are using to run the application and choose Edit. Take a screenshot of this page.

    Could you send the project archive and the screenshot to support@genuitec.com ATTN Brian, with a link to this thread? Please also include your subscription key and code.

    Hope to resolve this shortly.

    #343464

    Dattaprasad
    Member

    Hi Brian,

    Please see support@genuitec.com
    I have mailed you all the details.

    Let me know if you need more information.

    Thanks ,
    Dattaprasad

    #343738

    support-tony
    Keymaster

    Just closing off this topic.

    The issue was resolved by using an earlier version of the JDK (update 25). There may be a problem with update 40, though update 45 works fine.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Could not find or load main class jdk1.7

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in