• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Compiling a java file

I am trying to compile a java file using the javac command in a DOS window. I am having trouble with the line import com.merck.is.jdirectory.*;

How can I get DOS to recognize the location of jdirectory without giving a full filepath ?

import java.io.*;
import java.util.*;
import com.merck.is.jdirectory.*;
0
tomhughes
Asked:
tomhughes
  • 4
  • 3
  • 2
  • +3
1 Solution
 
bobbit31Commented:
make sure the jar containing com.merk.is.jdirectory is in your classpath.
0
 
kennethxuCommented:
where is your jdirectory is?
0
 
kennethxuCommented:
tomhughes, I also notice that you have a similar question at http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20520537.html

what's the situation? please follow up on your old question, thanks.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
cheekycjCommented:
I agree, this seems to be a duplicate of the original question.

CJ
0
 
coolshiuCommented:
I think that using ant to compile and deploy your .java files will be more convienent than using javac
you can get some document of using ant from
http://ant.apache.org
0
 
tomhughesAuthor Commented:
This question is a subset of the other question.
0
 
cheekycjCommented:
I think if you heed the advice of the experts in the other question it will solve this problem too.

CJ
0
 
cheekycjCommented:
As far as your question goes:

>How can I get DOS to recognize the location of jdirectory without giving a full filepath ?

if you don't want to manually provide the full path each time you compile, try adding the full path to your default CLASSPATH environment variable.

CJ
0
 
tojivCommented:
Question becomes a confusion when you are not describing it fully. There are many ways to make dos find out your packaged classes.
1. Which folder you are compiling from. For that compile from a folder that contains com directory.
2. The classpath variable set and also it should be like this. SET CLASSPATH=.;<YOUR EXISTING PATH>
3. give the full path itself while using javac which you are not prefering.
Check wheather one of the things missing. If not without saying no just describe the question fully.

Toji
0
 
kennethxuCommented:
>> Question becomes a confusion when you are not describing it fully.
Agree, and that's why we ask him to follow up on his old question and provide us with more detail, but looks like asker is not interested.

tomhughes, you got to help us to help you :)
0
 
tomhughesAuthor Commented:
I am going to use ant to compile.
0
 
kennethxuCommented:
good luck anting :)
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 4
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now