Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: There is some kind of Exception - Do not know the problem

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    My Mood
    Amazed
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation There is some kind of Exception - Do not know the problem

    package java;
    import java.util.Scanner;
    public class Project_1 {
    	public static void main(String args){
    		 Scanner fire = new Scanner(System.in);
    		 double firstnum, secondnum, answer;
    		 System.out.println("Enter your first number: ");
    		 firstnum = fire.nextDouble();
    		 System.out.println("Enter your second number: ");
    		 secondnum = fire.nextDouble();
    		 answer = firstnum + secondnum;
    		 System.out.println(answer);
    	}
     
     
     
    }

    These are the errors:
    Exception in thread "main" java.lang.SecurityException: Prohibited package name: java
    at java.lang.ClassLoader.preDefineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unkno wn Source)


    I don't know!


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: There is some kind of Exception - Do not know the problem

    java.lang.SecurityException: Prohibited package name: java
    The error message looks like it's in good English. Using java is not allowed.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    My Mood
    Amazed
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: There is some kind of Exception - Do not know the problem

    So I can't use the package name java?

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: There is some kind of Exception - Do not know the problem

    A rhetorical question, I hope.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: There is some kind of Exception - Do not know the problem

    See the error message. Prohibited package name
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. What kind of job's position is this?
    By solvable in forum The Cafe
    Replies: 7
    Last Post: January 10th, 2014, 05:42 PM
  2. What kind of job's position is this?
    By solvable in forum What's Wrong With My Code?
    Replies: 5
    Last Post: January 10th, 2014, 02:02 PM
  3. someone please be kind enough demonstrate a code like this......
    By willc86 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 23rd, 2013, 06:32 AM
  4. [SOLVED] What kind of object instantiation is this?
    By Lord Voldemort in forum Object Oriented Programming
    Replies: 3
    Last Post: July 7th, 2011, 07:00 AM
  5. Which collection is best to do mathematical operation on it?
    By Sterzerkmode in forum Java Theory & Questions
    Replies: 1
    Last Post: May 7th, 2009, 04:48 AM