Java / Netbeans Bundle Installation Question

M

marty mcmahone

I've just recently installed the Java/Netbeans bundle that puts both pieces
of software in the Program Files directory under Windows. I set the
ClassPath variable to point to the bin folder for Java. But I am having odd
problems.

If I don't use NetBeans, I can compile a simple class in Java. However, if
I try to compile another class that needs that class, Java won't recognize
that it's there. It also doesn't recognize the existence of the HttpServlet
classes. OTOH, if I do these compiles within NetBeans, they work.

Anybody have any insights into what I may be missing? I went with the
cobundle because the NetBeans install locked up when I tried to just install
it on my machine where I already had Java. I uninstalled everything before
I restarted the process. Still, something is buggered up.

Thanks,
Marty
 
M

Markku

marty said:
If I don't use NetBeans, I can compile a simple class in Java. However, if
I try to compile another class that needs that class, Java won't recognize
that it's there. It also doesn't recognize the existence of the HttpServlet

Are all the classes, .jars in the classpath?

- Markku -
 
M

marty mcmahone

Markku said:
HttpServlet

Are all the classes, .jars in the classpath?

Just talking about a couple of classes that I created. They're all in the
same folder, the way I've always done it. Haven't been doing anything to
set up classpaths for .jars in what I'm doing.
 
M

Markku

marty said:
Just talking about a couple of classes that I created. They're all in the
same folder, the way I've always done it. Haven't been doing anything to
set up classpaths for .jars in what I'm doing.

I asked about .jar because you said you are using HttpServlet.
With NetBeans you have these things available as resources but in
command line you need to define everything by yourself (or
use a system variable CLASSPATH).

The current folder is not in classpath by default. So compile
with "-classpath" option:

javac -classpath . MyClass.java MySecondClass.java

- Markku -
 
M

marty mcmahone

Markku said:
I asked about .jar because you said you are using HttpServlet.
With NetBeans you have these things available as resources but in
command line you need to define everything by yourself (or
use a system variable CLASSPATH).

The current folder is not in classpath by default. So compile
with "-classpath" option:

Thanks for pointing me in the right direction. Had been using a fairly
standard approach to things and forgotten about some of the effects of
ClassPath.

Marty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top