Results 1 to 3 of 3
  1. #1
    nat is offline Member
    Join Date
    Dec 2013
    Rep Power

    Default Error "package nameofthepackage does not exist"


    I am trying to make a jar file in intelliJ. My directory that holds all the java classes is C:\trafficProject\src\cege. In cege there is a package ui where there is a class GuiMain. And I have imported the GuiMain() in my Main() class.

    I have this code lines:

    package cege;

    import cege.ui.GuiMain;

    and when I use the terminal in the intelliJ and write the command:

    C:\trafficProject\src\cege>javac *.java

    I get this message: error: package cege.ui does not exist
    import cege.ui.GuiMain;

    but actually, I have already put this line in my code. This confuses me.

    Can anybody help me what could be the problem?

    Thanks in advance.

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Bali, Indonesia
    Rep Power

    Default Re: Error "package nameofthepackage does not exist"

    Instead of compiling from the cege directory try to compile it from the src directory:

    $javac cege\

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Error "package nameofthepackage does not exist"

    The package needs to be on the classpath. Add the path to the folder containing the start of the package to the classpath.
    classpath + package should give the full path to the class file.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. "Error cannot find symbol" "throws BadLocationException"
    By Daniel Silvester in forum New To Java
    Replies: 8
    Last Post: 07-02-2013, 02:53 AM
  2. Replies: 0
    Last Post: 12-07-2012, 09:29 AM
  3. Replies: 1
    Last Post: 11-03-2012, 12:38 AM
  4. How do I make a "File does not exist" error?
    By name in forum New To Java
    Replies: 13
    Last Post: 01-16-2012, 05:19 PM
  5. Replies: 2
    Last Post: 06-16-2011, 05:44 PM

Posting Permissions

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