• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packages

 
deepikakasi kasi
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Packages:

I have a doubt like how to run & compile a package source code.


As creating a new folder named package & under that source file is stored.

If I compile that, it is displaying as System cann't find that file.

How to run & compile that package ??


with regards,
Deepika.K.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepika, if you are new to Java, then please read this section- it will help you to understand the concept of package.
[ October 17, 2006: Message edited by: Chetan Parekh ]
 
GS Chidam
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

refer this url

http://www.jarticles.com/package/package_eng.html

thanks
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use pacakges, you are esseintally telling the complier that you are going to be placing and organizeing your code into sub-directories. A package is really nothing more than a directory on the filesystem. However, since Java is cross platform, you can't really use a normal directory notation, as Linux slashes are different from PC DOS slashes. So, Java uses a dot notation, and coins the cute little term 'package'

Getting packaged code to compile can definitely be annoyting. I put together a short multimedia tutorial that shows you exactly where a java source file should go when you want to package compile it, and how to run the source code generated by the compilation:

Using Packages with the JDK

JDK Tutorials for Compiling Packaged Code - Even Some Classpath Switches in there Too!!!


Working with the SDK is important, but eventually, you'll want to move to an IDE like Eclipse or use NetBeans or something.

Cheers!

-Cameron McKenzie
 
deepikakasi kasi
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the immediate reply..


thanks & regards,
Deepika.K.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic