commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Xu <togeorg...@gmail.com>
Subject [math] Help, how to compile? Thanks a huge
Date Mon, 07 Jan 2013 10:10:34 GMT
Hi,

I compiled with -CLASSPATH and it passed and generated the .class file.
(>dir *.class shows)

But when I ran with
>java -CLASSPATH  commons-math3-3.1.jar(full directory path) Test,
it complains "Error: Could not find or load main class Test".
BTW, is there introductionary PDF doc for questions like this?

George

On Mon, Jan 7, 2013 at 4:45 PM, Mat Jaggard <apache@jaggard.org.uk> wrote:

> You need to use -classpath when you run java as well as when you run javac.
>
> Also, you need to include [math] on your subject line when posting about
> that module to this list.
>
>
> On 7 January 2013 08:29, George Xu <togeorgexu@gmail.com> wrote:
>
> > Hi,
> >
> > Anyone can help? I am new and has difficulty in compiling with the .jar
> > files.
> >
> > I downloaded the .zip file, unzipped and put the 4 .jar files at
> > c:\Users\herehere.
> > I wrote a simple test code at the same directory(the current directory,
> as
> > above.
> > .(current directory) is at Environmental Variable, CLASSPATH. But it does
> > not
> > compile simply by .>Javac Test.java.
> >
> > I compiled with
> > .>javac -CLASSPATH c:\Users\herehere\xxx.jar Test.java (I explicitly
> spell
> > out
> > xxx and tried all four). The compike passed. But cannot .>java Test, and
> it
> > complains java.lang.NoClassDefFoundError.
> >
> > Help please,
> >
> >
> > ________________________________
> > import
> > java.util.*;
> > import
> > org.apache.commons.math3.*;
> > public
> > class Test {
> > public static void main(String[] args) {
> > System.out.println(
> > "Hello World!"); // Display the string.
> > Vector v=
> > new Vector();
> > v.add(
> > "1");v.add("2");v.add("3");v.add("4");v.add("5");
> > v.insertElementAt(v.remove(v.size()-1),0);
> > int i=0;
> > while(i<v.size()){
> > System.out.println(
> > "E @ i:\t"+v.get(i));
> > i++;
> > Acosh a=
> > new Acosh();
> > System.out.println(
> > "acosh:\t"+a.value(2.5));
> > }
> > }
> > }
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message