facebook

MyEclipse configuration jdk1.7 run-time error

  1. MyEclipse IDE
  2.  > 
  3. WebSphere Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #335720 Reply

    dcxy0
    Member

    My operating system is: fedora 18/32 bit
    MyEclipse version is: 10
    1. First I uninstall the system comes with: open – jdk1.6 [forced discharge]
    2. Then from oracle website and download the latest version of the jdk1.7
    3. I am in terminal execution javac, and Java compiler take package statement Java files can be normal operation.
    4. When I will jdk1.7 [local system, not MyEclipse own] attached to the MyEclipse and no error, when I was in MyEclipse inside implementation class, tip: could not find the main class or unable to load.
    Question:
    Please inform me about how to install your own MyEclipse additional the JDK. Or how to repair this problem? thank you
    The Java file is as follows:

    package com.w1520.test
     
    public class Test{
    public static void main (String []args){
                System.out.println("Hello World");//
    }
     
     
    }
    
    
    Exception:
     
     
    Exception in thread "main" java.lang.NoClassDefFoundError: JavaDemo (wrong name: com/w1520/JavaDemo/JavaDemo)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
    
    
    #335756 Reply

    support-swapna
    Moderator

    dcxy0,

    You do not need to delete the JDK which comes with MyEclipse. You can go to Windows > Preferences > Java > Installed JRE and add your JDK there and make it the default JDK.

    Incase you want to run MyEclipse with a different JRE, you have to make the change in the myeclipse.ini file which is located in the MyEclipse installation directory. Point the -vm argument to the new JRE.

    If you are referring to any third party libraries in your project, make sure the path is right.

    Let us know how it works for you.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: MyEclipse configuration jdk1.7 run-time error

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