Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The ridiculous Problem

 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I am facing problem, with packages and classpath...

1. How to set and remove classpath...
2. How to use package declaration in the java file...(give me one example)
3. How to import package in another java file...

i ve tried all these in many ways...
ever since i ve set the classpath... to the package/folder
whatever java file i m creating is getting duplicated with the extension .000, .001
like abc.java, as soon as i m saving it, it becomes abc.000, if i m again compiling it bocomes abc.001 like...
also i am unable to save that file.. and open
the error msg it displays
Access denied. ...

i ve to save my programs in to drive's root only, can not in any directory/folder/package ..
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1. How to set and remove classpath...

Have a read of our FAQ about this. Hopefully that will help. Let us know if you are still stuck.


2. How to use package declaration in the java file...(give me one example)




3. How to import package in another java file...

...with the import keyword:
 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Paul

Thnx paul but the main concern here is the file extension is
getting changed, and getting corrupted...
What to do for that?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Soni Mitesh:
...whatever java file i m creating is getting duplicated with the extension .000, .001
like abc.java, as soon as i m saving it, it becomes abc.000, if i m again compiling it bocomes abc.001 like...
also i am unable to save that file.. and open
the error msg it displays
Access denied. ...

i ve to save my programs in to drive's root only, can not in any directory/folder/package ..

Weird... Are you using an IDE with its own compiler? Or are you using Sun's javac compiler? Also, what operating system are you running?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic