This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes import my package/class in Redhat9 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "import my package/class in Redhat9" Watch "import my package/class in Redhat9" New topic
Author

import my package/class in Redhat9

may Lee
Ranch Hand

Joined: Nov 20, 2003
Posts: 68
Sir,

I am using j2sdk1.4.2 at Redhat 9, it is at /usr/java/j2sdk.../, now how can I put my own class or package, so the applet and servlet can both use it?

like

import jave.net.*;
import mypackage.myclass

public class ...{
int i;
myclass a;
....

How to compile after I import my package or class?
I can use "javac myjavaprogram.java" directly? or I must first
compile like "javac -d /$javahome/j2sdk../jre/class myjavaprogram.java

I am Not clear. Please give advise Sir or Madam


Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You can use javac directly, so long as javac is in the path, i.e. linux knows what program you are on about when you type "javac" and where to find it. You can put your own packages anywhere, so long as you add them to your classpath when you run javac.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import my package/class in Redhat9