• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Packages

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have downloaded source code from the internet and i have the .java files and the jar files. Im using Blue J and when i try copying the .java files into Blue J and compiling it says im trying to change the package statement to a package that does not exist in this project. Where do i find the package, is it inside the jar files and what do i do with the package. Thanks.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the beginner forum.
 
Marshal
Posts: 79240
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The simplest answer is not to use BlueJ.
It is not at all good at using packages.

Try
  • Copying the files to BlueJ with the package statements (always at the beginning of the file) left out.
  • Copying and pasting the class files to a proper IDE (eg NetBeans, Eclipse), but you will have to set up packages with the same names as your package statements.
  • Using a text editor or JCreator, with the package statements left in.

  • You may need to compile the classes individually, using
    javac -d . MyClass.java
    then to run them use
    java packagename.ClassName
    for the class with the main method in.
    See whether any of those is helpful
    CR
     
    CLUCK LIKE A CHICKEN! Now look at this tiny ad:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic