• Post Reply Bookmark Topic Watch Topic
  • New Topic

packages in Linux?  RSS feed

 
Mike Shn
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I use Linux (Red hat 7.3). I'm tyring create packages and import them and it gives me an error.
If I create package.. Is it correct for Linux?
package somePackage; // /home/mike/somePackage
import somePackage; // /home/mike/somePackage
I don't know but it gives me an error ..
Have to provide absolute path? How does it works?
Thanks
 
Vikas Varma
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try compiling it with the classpath option.
javac -classpath . somePath/*.java
This error occurs when you dont set the classpath value.
--Vikas
 
Mike Shn
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting
Somehow it works
[root@localhost mike]# javac -classpath Main.java somePackage/*.java
[root@localhost mike]#
But Don't understand why it didn't work before.
#1 Install SDK
[root@localhost mike]# java -version
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
#2 Setup Path in etc/profile
PATH=/usr/java/j2sdk1.4.0_01/bin:$PATH
#import pacakges and create packages.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!