[Biojava-l] Once more time

jon portuondo murguiondo jon portuondo murguiondo <jon.portuondo01@campus.upf.es>
Fri, 27 Dec 2002 17:50:32


Mensaje con FORMATO mime.
-------5981-----INFOMAIL-----
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Hi! I have tried all the options you proposed me, and none worked at all. SOS! 

I read the tutorial, very interesting.
 http://java.sun.com/docs/books/tutorial/java/interpack/packages.html

I tried to put the .class in this directory 
(relative to my CLASSPATH) 
 :/org/biojava/bio/program/PdbToXMLConverter.class 
 But it does'nt solve the problem. 

 If I put the .class in the directory where I run the 
 program, the error is the same. 

 On the other hand, if the .class is ONLY in the 
 package directory (the org/biojava....), I mean if I 
 remove the .class from the current directory, the 
 problem is: 
 
 [jon@diana ~]$ java PdbToXMLConverter 1FS1.pdb 
 Exception in thread "main" 
 java.lang.NoClassDefFoundError: PdbToXMLConverter 
 [jon@diana ~]$ 
 
In this configuration, if I type: 
 
[jon@diana program]$ java org.biojava.bio.program.PdbToXMLConverter /home/jon/1FS1.pdb
Exception in thread "main" java.lang.NoSuchMethodError: main

 I tried removing the package line "package 
org.biojava.bio.program" of the .java, but the error was the same than the previous one.

This is my extra-large CLASSPATH:
CLASSPATH=/home/jon:/home/jon/java/llibreries/biojava-20020823.jar:/home/jon/java/llibreries/xerces.jar:/home/jon/java/llibreries/bytecode-0.91.jar:/home/jon/java/llibreries/jakarta-regexp.jar:/home/jon/java/llibreries/xml.jar:/usr/java/j2re1.4.1_01/lib/javaplugin.jar/home/jon/java/biojava-live/src.

I suppose there are too much directories in the CLASSPATH but I'm trying all possibilities I can imagine.

I have downloaded the source of the library biojava-20020823 (that is in a .tar.gz file in that direction: http://biojava.org/download/source/
Inside this document I don't find the package java.lang...
If I compile the PdbToXmlConverter.java that is inside biojava-20020823.tar.gz, the problem is exactly the same that the previous one(I say that because you can download that file and try to make it run). 
I remember you I work in Linux with j2re1.4.1_01 and j2sdk1.
.4.1_01. 

The questions are:
Where is java.lang package? 
Is that in the biojava-20020823.jar library? 
Could be any problem with the version number? 
HOW CAN I SOLVE THE PROBLEM?
Thanks for all!

-------5981-----INFOMAIL-----
Content-Type: message/rfc822
Content-Transfer-Encoding: 8bit
Content-Disposition: inline

Return-Path: <biojava-l-admin@biojava.org>
Received: from infomail.es ([10.129.16.102]) by nsb5.infomail.inf
          (Netscape Messaging Server 3.6)  with ESMTP id AAA1542
          for <jon.portuondo01@campus.upf.es>;
          Tue, 10 Dec 2002 18:20:09 +0100
Received: from pw600a.bioperl.org ([155.94.54.80]) by infomail.es
          (Tid InfoMail Exchanger v2.20) with SMTP id #1039540821.191530001;
          Tue, 10 Dec 2002 18:20:21 +0100
Received: from pw600a.bioperl.org (localhost [127.0.0.1])
	by pw600a.bioperl.org (8.12.6/8.12.6) with ESMTP id gBAHGAAW020220;
	Tue, 10 Dec 2002 12:16:10 -0500
Received: from web14907.mail.yahoo.com (web14907.mail.yahoo.com [216.136.225.59])
	by pw600a.bioperl.org (8.12.6/8.12.6) with SMTP id gBAHFaAW020194
	for <biojava-l@biojava.org>; Tue, 10 Dec 2002 12:15:37 -0500
Message-ID: <20021210171601.93080.qmail@web14907.mail.yahoo.com>
Received: from [128.240.229.6] by web14907.mail.yahoo.com via HTTP; Tue, 10 Dec 2002 17:16:01 GMT
From: =?iso-8859-1?q?Matthew=20Pocock?= <matthew_pocock@yahoo.co.uk>
Subject: Re: [Biojava-l] It's me once again
To: jon portuondo murguiondo <jon.portuondo01@campus.upf.es>,
       biojava-l@biojava.org
In-Reply-To: <1039518882.21896@mail.infomail.es>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Status: No
X-Spam-Status: No
X-Scanned-By: MIMEDefang 2.26 (www . roaringpenguin . com / mimedefang)
Sender: biojava-l-admin@biojava.org
Errors-To: biojava-l-admin@biojava.org
X-BeenThere: biojava-l@biojava.org
X-Mailman-Version: 2.0.12
Precedence: bulk
List-Help: <mailto:biojava-l-request@biojava.org?subject=help>
List-Post: <mailto:biojava-l@biojava.org>
List-Subscribe: <http://biojava.org/mailman/listinfo/biojava-l>,
	<mailto:biojava-l-request@biojava.org?subject=subscribe>
List-Id: Biojava discussion list <biojava-l.biojava.org>
List-Unsubscribe: <http://biojava.org/mailman/listinfo/biojava-l>,
	<mailto:biojava-l-request@biojava.org?subject=unsubscribe>
List-Archive: <http://biojava.org/pipermail/biojava-l/>
Date: Tue, 10 Dec 2002 17:16:01 +0000 (GMT)
X-Infomail-Id: 1039540821.4AD1010A811066.40821

Hi,

Try reading through this tutorial. It should help fill
the gaps.

http://java.sun.com/docs/books/tutorial/java/interpack/packages.html

> I tried to put the .class in this directory
> (relative to my CLASSPATH)
> :/org/biojava/bio/program/PdbToXMLConverter.class
> But it does'nt solve the problem.
> If I put the .class in the directory where I run the
> program, the error is the same.
> On the other hand, if the .class is ONLY in the
> package directory (the org/biojava....), I mean if I
> remove the .class from the current directory, the
> problem is: 
> 
> [jon@diana ~]$ java PdbToXMLConverter 1FS1.pdb
> Exception in thread "main"
> java.lang.NoClassDefFoundError: PdbToXMLConverter
> [jon@diana ~]$

In this configuration, you would need to type:

java org.biojava.bio.program.PdbToXMLConverter
lFSl.pdb

Notice that the package prefix to the class matches
the package of the classes package & it's location.

> 
> I tried removing the package line "package
> org.biojava.bio.program" but the following error
> ocurred while compiling:
> 
> [jon@diana ~]$ javac PdbToXMLConverter2.java
> PdbToXMLConverter2.java:69: invalid method
> declaration; return type required
>     public PdbToXMLConverter(String poInput) {
>            ^
> 1 error

This is because you have renamed the class to
PdbToXMLConverter2, but have not renamed the
constructor to match the class name. Rename this
constructor to match the class name and try again.
Make sure that you use

java PdbToXMLConverter2 lFSl.pdb

OH. The name of a java class and of it's file must
match if it is a public class. So, if you have a class
called Foo, it must be in a file called Foo.java and
will produce a class file Foo.class and will have a
constructor called Foo() and you would run its main
method as java Foo <args>..

If it is in package bar, then the class is bar.Foo,
and it will be in a file bar/Foo.java and will produce
a class file bar/Foo.class and if it has a main method
you run it as java bar.Foo <args>.

Best,

Matthew

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
_______________________________________________
Biojava-l mailing list  -  Biojava-l@biojava.org
http://biojava.org/mailman/listinfo/biojava-l

-------5981-----INFOMAIL-------