Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2016
    Posts
    2
    Rep Power
    0

    Default Am getting error for the following program. Kindly rectify.

    Program

    package com.example.java;

    public class Main {

    public static void main(String[] args) {
    byte b=1;
    short sh=1;
    int i=1;
    long l=1L;
    float f=1f;
    double d=1d;
    System.out.println("Byte : " +b);
    System.out.println("Short : " +sh);
    System.out.println("Int : " +i);
    System.out.println("Long : " +l);
    System.out.println("Float : " +f);
    System.out.println("Double : " +d);
    }

    }



    Error

    "C:\Program Files (x86)\Java\jdk1.6.0_24\bin\java" -Didea.launcher.port=7533 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.4\New folder (9)\IntelliJ IDEA Community Edition 15.0.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\charsets.jar;C:\Pro gram Files (x86)\Java\jdk1.6.0_24\jre\lib\deploy.jar;C:\Progr am Files (x86)\Java\jdk1.6.0_24\jre\lib\ext\dnsns.jar;C:\Pr ogram Files (x86)\Java\jdk1.6.0_24\jre\lib\ext\localedata.jar; C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\ext\sunjce_provider .jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\ext\sunmscapi.jar;C :\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\ext\sunpkcs11.jar;C :\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\javaws.jar;C:\Progr am Files (x86)\Java\jdk1.6.0_24\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\plugin.jar;C:\Progr am Files (x86)\Java\jdk1.6.0_24\jre\lib\resources.jar;C:\Pr ogram Files (x86)\Java\jdk1.6.0_24\jre\lib\rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.4\New folder (9)\IntelliJ IDEA Community Edition 15.0.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.example.java.Main
    Exception in thread "main" java.lang.ClassNotFoundException: com.example.java.Main
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.intellij.rt.execution.application.AppMain.main (AppMain.java:122)

    Process finished with exit code 1

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,993
    Rep Power
    9

    Default Re: Am getting error for the following program. Kindly rectify.

    Nothing wrong with the code. There is something wrong with IntelliJ IDEA run configuration. Make sure you have selected the correct module for setting "Use classpath of module"
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    Join Date
    Mar 2016
    Posts
    2
    Rep Power
    0

    Default Re: Am getting error for the following program. Kindly rectify.

    Thanks for your quick reply. But am not getting module for setting "Use classpath of module"

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Am getting error for the following program. Kindly rectify.

    Exception in thread "main" java.lang.ClassNotFoundException: com.example.java.Main
    For the command: java com.example.java.Main
    to find the class to execute, the classpath must point to the folder that contains the com folder.
    The IDE must have a way to set the classpath.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,993
    Rep Power
    9

    Default Re: Am getting error for the following program. Kindly rectify.

    Run/Debug Configuration: Application -> Configuration tab -> Use classpath of module

    https://www.jetbrains.com/help/idea/...rigin=old_help
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  6. #6
    Sizzlewump's Avatar
    Sizzlewump is offline Member
    Join Date
    Oct 2010
    Location
    MI, USA
    Posts
    68
    Rep Power
    0

    Default Re: Am getting error for the following program. Kindly rectify.

    Are you still having trouble? What about your import statements?
    "The secret to getting what you want is to reject everything that you don't want." -Wolbers

Similar Threads

  1. How to Rectify this error?
    By tamilarasi in forum Web Frameworks
    Replies: 1
    Last Post: 12-10-2012, 02:50 PM
  2. How to Rectify this error?
    By tamilarasi in forum Web Service Codes
    Replies: 0
    Last Post: 12-10-2012, 01:39 PM
  3. Please Help to rectify
    By roshmahee in forum New To Java
    Replies: 4
    Last Post: 03-24-2011, 02:32 PM
  4. Kindly Help me..DICE PROGRAM
    By aronkevin in forum Advanced Java
    Replies: 1
    Last Post: 10-08-2010, 08:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •