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 7 of 7

Thread: Package does not exsist

  1. #1
    Member
    Join Date
    Jan 2011
    Posts
    88
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Question Package does not exsist

    I dont understand why its not finding it. its there and its spelled correctly. Im new to packaging heres my error

    ..\src.\Algebra\Calculator.java:9: package Algebra.Functions does not exist
    import Algebra.Functions.*;
    ^
    1 error
    Press any key to continue . . .

    and here is my imports
    package Algebra;
     
    import java.text.*;
    import java.io.*;
    import javax.swing.JOptionPane;
    import javax.swing.Timer;
     
    import Algebra.Functions.*;

    whats wrong?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Package does not exsist

    Could you show your file/folder structure?
    And the classpath you are using when you compile the program.
    The classpath should point to the folder containing the folder that starts the package, in your case the Algebra folder should be in the folder at the end of the classpath.

  3. #3
    Member
    Join Date
    Jan 2011
    Posts
    88
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Package does not exsist

    folder structure is this: src>Algebra (contains Calculator)>Functions (Contains onestep, and twostep)
    idk if thats what u were asking for or not

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Package does not exsist

    What is the value of the classpath when you compile the program?
    The full path consisting of the classpath concatenated with the package path should point to the class file.
    C:/test/java/Algebra/Functions/<function classes>
    classpath = C:/test/java
    package = Algebra/Functions

  5. The Following 2 Users Say Thank You to Norm For This Useful Post:

    frozen java (May 31st, 2011), javapenguin (May 31st, 2011)

  6. #5
    Member
    Join Date
    Jan 2011
    Posts
    88
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Package does not exsist

    "C:\Program Files\Java\jdk1.6.0_22\bin\javac.exe" -cp . -d ../bin/ ../src./Algebra/*.java

  7. #6
    Member
    Join Date
    Jan 2011
    Posts
    88
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Package does not exsist

    i get what u are saying now. i fixed it thank you!

  8. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Package does not exsist

    classpath is tough. It took me months to master it.

Similar Threads

  1. Package help for a newbie
    By Skunkle in forum Java Theory & Questions
    Replies: 3
    Last Post: April 15th, 2011, 01:09 PM
  2. Package confusion
    By caesius in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 21st, 2011, 11:08 PM
  3. Is it possible to package Java
    By UnderWater2 in forum Java Theory & Questions
    Replies: 1
    Last Post: November 2nd, 2010, 01:31 AM
  4. creating a package
    By x3rubiachica3x in forum Object Oriented Programming
    Replies: 6
    Last Post: September 26th, 2010, 11:10 PM
  5. [SOLVED] Finding acm package
    By javapenguin in forum What's Wrong With My Code?
    Replies: 1
    Last Post: June 12th, 2010, 11:50 AM

Tags for this Thread