Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-12-2007, 04:56 AM
Member
 
Join Date: Oct 2007
Posts: 7
Bibendum is on a distinguished road
Java Package help?
I just went through the painful process of trying to get a package working for the first time, but I have one last problem.

I have a package myPackage.geom, with a couple of geometry classes in it.

It is saved to C:\Users\Joe\java\myClasses\geom\*. I want to get the package to work from another folder, C:\Users\Joe\Java\Puzzle\. However, when I just put import myClasses.geom.*; at the beginning of a file in \Puzzle\, it says that myClasses.geom doesn't exist. How do I get it so that \Puzzle\ can "see" the myClasses package?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-12-2007, 05:35 AM
Senior Member
 
Join Date: Nov 2007
Location: Newport, WA
Posts: 141
staykovmarin is on a distinguished road
You need "C:\Users\Joe\java\myClasses\geom\" in your classpath when you run java:
Code:
java -classpath C:\Users\Joe\java\myClasses\geom\ FileToRun
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-12-2007, 06:29 AM
Member
 
Join Date: Oct 2007
Posts: 7
Bibendum is on a distinguished road
I tried that, and now it gives a NoClassDefFoundError whenever I try to run it. This solution seems a little weird, though. If I want to run a file that's just in java\puzzle\, wouldn't setting the classpath to java\myClasses\geom\ make it not even see \puzzle\? How do you set it so that a package is accessible from anywhere else on the computer without having to change the classpath every time? I know it's possible, all of the default Java packages work that way, like java.awt.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JXL Package gaya3 Java Servlet 1 05-23-2008 11:03 AM
Demonstration of Stack class in java.util package Java Tip java.lang 0 04-17-2008 12:33 AM
How to use Stack class in java.util package Java Tip java.lang 0 04-17-2008 12:32 AM
java package for ISDN syedumairali Networking 0 01-20-2008 10:11 PM
couldn't find the package java.lang katie New To Java 2 08-04-2007 07:04 PM


All times are GMT +3. The time now is 04:06 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org