LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-12-2008, 05:55 AM   #1
nano2
Member
 
Registered: May 2007
Posts: 100

Rep: Reputation: 15
Java 1.5


Hi ,

I am using the following java disto
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux
but am getting the following errror message at runtime
Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in acc.jar file:/usr/share/java/libgcj-3.4.6.jar, file:./, core:/

Now when i look in libgcj-3.4.6.jar the StringBuilder class is not found .

Does anyone know where I can locate this or is the StringBuilder functions not in this version of Java ..

Any suggestions much appreciated .
Thanks
 
Old 05-12-2008, 09:36 AM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I apologize for this not being much help, but GCJ makes my toes curl - it's nice that it compiles Java to a native Linux binary, but aside from that, it really serves no other purpose that to frustrate Java programmers. I ran into this problem so many times (and never found a solution) where I would write a quick program, compile it without any errors, and then it would refuse to run with a bullsh*t error, like that one.

Are you making a call to the StringBuilder class in your program, or do you have anything like
Code:
String s = "hello " + "world";
in your code?
 
Old 05-13-2008, 03:39 AM   #3
nano2
Member
 
Registered: May 2007
Posts: 100

Original Poster
Rep: Reputation: 15
Yes, I am calling the StringBuilder class ..
 
Old 05-13-2008, 05:29 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Is there a specific reason for you not to use Sun JVM ?
 
Old 05-13-2008, 08:15 AM   #5
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Hmm...as a proposed solution, I read up on the java.lang.StringBuilder class, and it appears to just be used for building Strings out of other various types.

Try this, perhaps (depending on your needed usage)?:
Code:
...
   String s = "";

   s += Integer.toString(someInt);
   s += Boolean.toString(someBoolean);
...
Essentially, just using the class versions of the basic types to convert the values to a String.
 
Old 05-13-2008, 09:29 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
StringBuilder purpose is not to provide these append methods as they already existed in the older StringBuffer class.
Your sample code is using StringBuffer under the hood.
StringBuilder purpose is to boost performance when the string isn't used by more than one thread, a common situation.
 
Old 05-13-2008, 09:47 AM   #7
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Ah - okay. Thanks for that jlliagre.

I just looked at the GCJ site, and there is no 3.4.6 release - it may have just been a minor, bugfix release. If I may suggest upgrading to GCJ 4.3.0.

How are you compiling, and trying to run the particular program?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
Ubuntu 7.10 64bit - how to set java path to/redirect java to libjvm.so ? Thane Ubuntu 1 03-25-2008 05:52 PM
LXer: Java news met with cautious optimism in free Java community LXer Syndicated Linux News 0 11-14-2006 10:21 PM
Firefox refuses to load Java jnlp files - plugin and java ok Melsync Linux - Software 1 06-25-2006 04:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration