Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

import my package/class in Redhat9

 
may Lee
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic