Help with javac, jar, etc.

R

Ryan Rushton

I'm trying to get started with JSP development, but am having some
problems with my Java environment. I have installed the J2EE SDK from
Sun and have set up Tomcat 5. However, I'm having problems when I try
to run command line operations. For example:

C:\JSP> jar xvf jspbook3.zip
'JAR' is not recognized as an internal or external command,
operable program or batch file.

I get a similar error when I try to use javac.

Admittedly, I'm a complete novice when it comes to this stuff, so I
may have set things up incorrectly somewhere. Can anyone point me in
the right direction?

Thanks,
Ryan
 
B

Bryce

I'm trying to get started with JSP development, but am having some
problems with my Java environment. I have installed the J2EE SDK from
Sun and have set up Tomcat 5. However, I'm having problems when I try
to run command line operations. For example:

C:\JSP> jar xvf jspbook3.zip
'JAR' is not recognized as an internal or external command,
operable program or batch file.

I get a similar error when I try to use javac.

Admittedly, I'm a complete novice when it comes to this stuff, so I
may have set things up incorrectly somewhere. Can anyone point me in
the right direction?

Is jar in your classpath?
 
B

Bryce

I'm trying to get started with JSP development, but am having some
problems with my Java environment. I have installed the J2EE SDK from
Sun and have set up Tomcat 5. However, I'm having problems when I try
to run command line operations. For example:

C:\JSP> jar xvf jspbook3.zip
'JAR' is not recognized as an internal or external command,
operable program or batch file.

I get a similar error when I try to use javac.

Admittedly, I'm a complete novice when it comes to this stuff, so I
may have set things up incorrectly somewhere. Can anyone point me in
the right direction?

errr.... forget my last message. What I MEANT to ask was:

is jar.exe in your path
 
A

Andrew Thompson

I'm trying to get started with JSP development, but am having some
problems with my Java environment. I have installed the J2EE SDK from
Sun and have set up Tomcat 5. However, I'm having problems when I try
to run command line operations. For example:

I am pretty sure you also need
the J2*SE*SDK to do command line
compilation, make jar files..

Though I do not know of anybody
who has tried J2EE SDK without
first J2*SE*SDK..
 
H

Hal Rosser

Murach has a good book that walks you through it,
www.murach.com
Look for something like "Java Servlets and JSP"
I used it as a newbie - and it walked me through with no problem.
 
G

gajo

Hal Rosser said:
Murach has a good book that walks you through it,
www.murach.com
Look for something like "Java Servlets and JSP"
I used it as a newbie - and it walked me through with no problem.

Or perhaps he should try "Thinking in Java" from Bruce Eckel? That was the
book I learned from everything ;)
Anyway, IMHO beginners should not start learning Java with complicated
editors like Eclipse and Tomcat (AFAIK it's an editor too, not?), but a
simple Notepad or some other simple tool that may support syntax coloring,
but DOES NOT COMPILE AND RUN THE PROGRAM for the programmer. If the
programmer learns to compile his program from the command line, then later
he will have no trouble of the kind Ryan had here. Otherwise he will get
into a situation that his applications cannot run on other computers because
of a CLASSPATH error, and he doesn't know that and can't fix the problem.
 
H

Hal Rosser

TIJ is a good book, and I tried that first, but I was really impressed with
Murach's books.
As for the tool to use writing program - I agree he should start out using a
text editor and command prompt.
the next small step up is to something like JGrasp. It has a short learning
curve, and colorizes the syntax - and lets you step through the code to
debug.
Eclipse and netbeans are good - but you need a month to learn how to use
them.
 
R

Ryan Rushton

Thanks everyone. Lots of great advice here and I can tell you it was
much appreciated. After looking over your posts I was able to track
down the problem. I had incorrectly set my PATH to
"C:\Sun\AppServer\bin". I changed this to "C:\Sun\AppServer\jdk\bin"
and now everything is working as expected. Thanks again.

-- Ryan
 
B

Bryce

Thanks everyone. Lots of great advice here and I can tell you it was
much appreciated. After looking over your posts I was able to track
down the problem. I had incorrectly set my PATH to
"C:\Sun\AppServer\bin". I changed this to "C:\Sun\AppServer\jdk\bin"
and now everything is working as expected. Thanks again.

What I do is set an environment variable called:

JAVA_HOME, and point it to my JDK root directory.

Then I set my path = %JAVA_HOME%\bin

Some java programs look for the environment variable JAVA_HOME. Also,
enables me to switch JDKs easily.
 

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,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top