FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Java

 
 
LinkBack Thread Tools
 
Old 05-04-2012, 10:38 PM
"bilsch"
 
Default Java Linux problem or Java problem?

I am running Ubuntu 11.10. Running Java 7.0.1 with NetBeans. I wrote a java
program with a loop that reads a 26000 character text file (NVRAM.TXT) into
a character array. It worked fine. I ran the program numerous times over
four days. I have not made any changes to the java file. The program is
listed below. It has only 24 lines. Today when I run it, it has weird
errors referenced toline numbers 2442, 2685 and 1620. When I click on those
error messages it shows lines in
a huge completely different program - a program that I never wrote. I cut
and pasted the source (24 lines) of the offending file into a new empty java
file in a new project. The new project and file have different names than
the original names. It runs fine with the new name - no errors. The file
name that has the problem is Nvj5.java. That is the file selected and
displayed when I click RUN FILE. It is the file listed below. Even though it
is selected and displayed when I click RUN FILE my system is running some
other huge file (with errors) instead. The errors is copied below. Has
anyone ever heard of a problem like this? Please help. I asked questions in
a Java news group but they haven'tcome up with anything yet.

TIA Bill S.

HERE'S THE ERROR OUTPUT:
run:
Exception in thread "main" java.lang.VerifyError: Constructor must call
super() or this() before return in method Nvr1.<init>()V at offset 0
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.ja va:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at sun.launcher.LauncherHelper.getMainMethod(Launcher Helper.java:488)
at sun.launcher.LauncherHelper.checkAndLoadMain(Launc herHelper.java:480)
Java Result: 1


HERE'S THE JAVA FILE:
import java.io.*;
public class Nvj5 {
public static void main(String[] args){
try {
FileInputStream file = new FileInputStream("NVRAM.TXT");
char[] nvchr = new char [30000];
int fin = 1;
int count = 1;
while (fin != -1) {
fin = file.read();
nvchr[count] = (char) fin;
System.out.print(nvchr[count]);
count++;
}
System.out.println("Bytes read : " + count);
file.close();
} catch (IOException e){
System.out.println("Could not read file");
}

}
}


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jo1lpg$rt1$1@dont-email.me">http://lists.debian.org/jo1lpg$rt1$1@dont-email.me
 
Old 05-05-2012, 08:23 AM
"Niels Thykier"
 
Default Java Linux problem or Java problem?

On May 5, 2012 00:38 "bilsch" <king621@comcast.net> wrote:
> [...]
>
> TIA Bill S.
>

Hi,

> HERE'S THE ERROR OUTPUT:
> run:
> Exception in thread "main" java.lang.VerifyError: Constructor must
> call
> super() or this() before return in method Nvr1.<init>()V at offset 0
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Class.ja va:2442)
> at java.lang.Class.getMethod0(Class.java:2685)
> at java.lang.Class.getMethod(Class.java:1620)
> at sun.launcher.LauncherHelper.getMainMethod(Launcher Helper.java:488)
> at
> sun.launcher.LauncherHelper.checkAndLoadMain(Launc herHelper.java:480)
> Java Result: 1
>
>
> [...]
>
>

Looks like the byte-code verification fails. If it was compiled with
an older version of Java, it is possible that the new version is more
strict (or maybe it has a bug - not sure).

Try recompiling the Java file with the same version of Java as you are
using to run it.

~Niels


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120505082310.9460717AD68EC@bmail03.one.com">http ://lists.debian.org/20120505082310.9460717AD68EC@bmail03.one.com
 
Old 05-05-2012, 10:44 PM
bilsch
 
Default Java Linux problem or Java problem?

On 05/05/2012 01:30 AM, Niels Thykier wrote:

On May 5, 2012 00:38 "bilsch"<king621@comcast.net> wrote:

[...]

TIA Bill S.



Hi,


HERE'S THE ERROR OUTPUT:
run:
Exception in thread "main" java.lang.VerifyError: Constructor must
call
super() or this() before return in method Nvr1.<init>()V at offset 0
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.ja va:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at sun.launcher.LauncherHelper.getMainMethod(Launcher Helper.java:488)
at
sun.launcher.LauncherHelper.checkAndLoadMain(Launc herHelper.java:480)
Java Result: 1


[...]




Looks like the byte-code verification fails. If it was compiled with
an older version of Java, it is possible that the new version is more
strict (or maybe it has a bug - not sure).

I think you're right. I made changes to my PATH variable. Problem has
gone away for the present time. Thank you.



Try recompiling the Java file with the same version of Java as you are
using to run it.

~Niels





--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jo4ags$csb$1@dont-email.me">http://lists.debian.org/jo4ags$csb$1@dont-email.me
 
Old 05-17-2012, 11:21 PM
bilsch
 
Default Java Linux problem or Java problem?

On 05/05/2012 01:30 AM, Niels Thykier wrote:

On May 5, 2012 00:38 "bilsch"<king621@comcast.net> wrote:

[...]

TIA Bill S.



Hi,


HERE'S THE ERROR OUTPUT:
run:
Exception in thread "main" java.lang.VerifyError: Constructor must
call
super() or this() before return in method Nvr1.<init>()V at offset 0
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.ja va:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at sun.launcher.LauncherHelper.getMainMethod(Launcher Helper.java:488)
at
sun.launcher.LauncherHelper.checkAndLoadMain(Launc herHelper.java:480)
Java Result: 1


[...]




Looks like the byte-code verification fails. If it was compiled with
an older version of Java, it is possible that the new version is more
strict (or maybe it has a bug - not sure).

Try recompiling the Java file with the same version of Java as you are
using to run it.

~Niels



Thanks again for the info.


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jp414u$u08$1@dont-email.me">http://lists.debian.org/jp414u$u08$1@dont-email.me
 

Thread Tools




All times are GMT. The time now is 07:29 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org