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

    Default Error "package nameofthepackage does not exist"

    Hello,

    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:

    Main.java:3: 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
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    8

    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\Main.java

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,307
    Rep Power
    25

    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, 01:53 AM
  2. Replies: 0
    Last Post: 12-07-2012, 08:29 AM
  3. Replies: 1
    Last Post: 11-02-2012, 11:38 PM
  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, 04:19 PM
  5. Replies: 2
    Last Post: 06-16-2011, 04: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
  •