what do I download?


I have absolutely no clue about java programmming, but I found a little program on the internet that I want to use.

The first step in the directions is:

1. Install the latest JDK

so, I do a search on it and I'm at-

ok, so what do I download, the one under JRE right?

the other steps in the directions say to get Xalan XML Parser and Xerces XSLT Processor and put it in my CLASSPATH.

so, I'm over at www.apache.org going nuts, because it seems there are tons of versions of things and well I really don't know what to download there.
I'm taking a guess my CLASSPATH is wherever I end installing the JDK?

Finally, the last step is to unzip the news.jar to my CLASSPATH. I'm taking another guess that once I get the JDK installed, I'm suppose to somehow run the news.jar?
Anyway, any help on what download part much appreciated. =)

Hopefully this won't be too hard for me. ;)
I remember installing Perl on my computer a long time ago, don't remember that being to hard.

Computer specs: win95 266mhz pentium II mmx 128ram
Who is Participating?
Ok, sorry. A Java class is defined by its name and its package. You can identify the package if you look at the directories the class is in. E.g. if JNews is in the directory com\news\JNews.class, then the commmand is

java -classpath xerceslmpl.jar;xalan.jar;news.jar com.news.JNews

why don't u try a simple hello world program then go a head
If you just want to do Java programming, why would you need the XML parser and the XSLT processor?  You'd only need these if you are going to do Java programming to make WEB APPLICATIONS.

If you want to learn Java programming to create PC applications/software, JDK is the only software you need (and as you said, you've already downloaded it).

By the way, what does the Java sample program that interested you to try out do?
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Oops, I just saw that you just downloaded the JRE.  What you needed to download is the SDK (software development kit).  JRE means java runtime environment, it only runs your java programs.  To compile your java programs, you need the SDK.
Also the SDK you download would have lots of sample programs you can study.  Plus, if you want good tutorials, check

http://developer.java.sun.com/developer/onlineTraining/Some of them are even downloadable.
Hmmm I think he does not want to program in Java. He only wants to try an executable jar file.
Install the jre(the link you already have). Then install Xalan and xerces. You can find them at  http://xml.apache.org/xalan-j/index.html (binary distribution) and http://gump.covalent.net/jars/latest/xml-xerces2/  Put them on your harddisk and put their full paths in the CLASSPATH. To run the news.jar file just doubleclick it.
I'm not sure but i think this is all you have to do.

if you want to run the news.jar (it seems to use XML parser and XSl Stylesheet processor internally), the JRE is correct.

Download the Java XML Pack - Spring 02 Release from http://java.sun.com/xml/downloads/javaxmlpack.html

Unpack it. You will find a jaxp-XXX directory in the java-xml-pack-XXX dir. In this directory you will find the xerces.jar and xalan.jar you need.

copy both jars to the place your news.jar is. Get a shell and change to the directory the news.jar is.

Type the following command:

java -classpath xerces.jar;xalan.jar;. -jar news.jar
(if you are under Unix, replace ; with :)

That will hopefully solve your problem.
Have fun with Java :-)

sayhiAuthor Commented:
yes, I think some of you didn't read carefully ;)

okay, iartmirko, I will download the JRE and follow your link and directions. we'll see what happens... :o)
sayhiAuthor Commented:
alrighty, here's what i've done:

i extracted xalan.jar out of the package and 2 files called xsltc.jar and xerceslmpl.jar into the same folder.
i wasn't sure which (xsltc or xerces) jars to use, so i tried both.

went to my MS-DOS prompt and typed:
java -classpath xerceslmpl.jar;xalan.jar; -jar news.jar

then it says
Failed to load Main-Class manifest attribute from news.jar

so tried:
java -classpath xsltc.jar;xalan.jar; -jar news.jar
and got same error message

so now I am stuck.
sayhiAuthor Commented:
Hmm, reading over the comments again, should I have download the SDK? what is the difference between running and compiling?
sayhiAuthor Commented:
Doubled the points. =)

Arg, this is getting more and more complicated I think hehe. Went to http://java.sun.com/docs/books/tutorial/jar/basics/mod.html to read about the manifest file. Looks pretty involved to me. Though, I won't give up on this just yet. ;)

my news.jar has 4 classes in it
The first call was right (java -classpath xerceslmpl.jar;xalan.jar; -jar news.jar). It failed because news.jar is not a executable jar file. You can specify the Main class in the manifest file of a jar, if you want to make things easier for users...they haven't done this.

So do the falling call in the directory the .jars are:

java -classpath xerceslmpl.jar;xalan.jar;news.jar XXX

Where XXX is the name of the class in the news.jar (try every 4, because I don't know which one is the main class) Class names are case sensitiv and don't attach the .class. If a class in the jar would have the name NewsReader.class the call would be:

java -classpath xerceslmpl.jar;xalan.jar;news.jar NewsReader

Good luck ;)



sayhiAuthor Commented:
Exception in thread "main" java.lang.NoClassDefFoundError: JNews
sayhiAuthor Commented:

Exception in thread "main" java.lang.NoSuchMethodError: main

okay after this, I think i'll quit lol ;)
sayhiAuthor Commented:
nm, got it =)

thanks for all your help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.