Solved

what do I download?

Posted on 2002-04-15
15
369 Views
Last Modified: 2013-11-23
Hello,

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-
http://java.sun.com/j2se/1.3/download.html

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
0
Comment
Question by:sayhi
  • 7
  • 3
  • 3
  • +2
15 Comments
 
LVL 1

Expert Comment

by:naveeth
ID: 6943975
why don't u try a simple hello world program then go a head
0
 

Expert Comment

by:jodear
ID: 6944142
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?
0
 

Expert Comment

by:jodear
ID: 6944149
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.
0
 

Expert Comment

by:jodear
ID: 6944177
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.
0
 
LVL 2

Expert Comment

by:DidierD
ID: 6944799
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.
0
 
LVL 1

Expert Comment

by:iartmirko
ID: 6945121
Hi,

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 :-)

Mirko
0
 
LVL 1

Author Comment

by:sayhi
ID: 6946227
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)
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:sayhi
ID: 6946326
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.
0
 
LVL 1

Author Comment

by:sayhi
ID: 6946334
Hmm, reading over the comments again, should I have download the SDK? what is the difference between running and compiling?
0
 
LVL 1

Author Comment

by:sayhi
ID: 6946360
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
0
 
LVL 1

Expert Comment

by:iartmirko
ID: 6948260
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 ;)

Mirko

 


0
 
LVL 1

Author Comment

by:sayhi
ID: 6949155
Exception in thread "main" java.lang.NoClassDefFoundError: JNews
0
 
LVL 1

Accepted Solution

by:
iartmirko earned 101 total points
ID: 6951254
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

Mirko
0
 
LVL 1

Author Comment

by:sayhi
ID: 6955022
heh

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

okay after this, I think i'll quit lol ;)
0
 
LVL 1

Author Comment

by:sayhi
ID: 6961141
nm, got it =)

thanks for all your help
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now