Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

how to add a new pacakage

Thread view: 
naren - 25 Sep 2006 15:57 GMT
please help me how to use a new pacakage in my java program
Oliver Wong - 25 Sep 2006 16:21 GMT
> please help me how to use a new pacakage in my java program

   Are you using an IDE?

   - Oliver
naren - 25 Sep 2006 16:27 GMT
no
Tor Iver Wilhelmsen - 25 Sep 2006 16:41 GMT
> no

Then add the jar or dirs to the classpath as you compile and run,
using the -classpath command-line switch.

javac -classpath SomeLibrary.jar com/mypackage/MyClass.java

java -classpath .;SomeLibrary.jar com.mypackage.MyClass
naren - 25 Sep 2006 17:17 GMT
can i set Class path in the environment variables ?
Mark Jeffcoat - 25 Sep 2006 18:35 GMT
> can i set Class path in the environment variables ?

Yes. The variable's name is CLASSPATH.

Signature

Mark Jeffcoat
Austin, TX

naren - 25 Sep 2006 17:26 GMT
i am not able to rum my prog in cmd, its getting compiled but not
running showing the error
Hendrik Maryns - 26 Sep 2006 08:44 GMT
naren schreef:
> i am not able to rum my prog in cmd, its getting compiled but not
> running showing the error

Yes?

- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Tor Iver Wilhelmsen - 27 Sep 2006 17:50 GMT
> i am not able to rum my prog in cmd, its getting compiled but not
> running showing the error

You forgot to show us the error message; but you need the same
classpath when running as when you compiled. If you use a CLASSPATH
env var you should be fine - but remember to also add the dir that is
the root of you class' package, e.g.

java -classpath some\directory;%CLASSPATH% your.package.and.Class

on Windows.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.