This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!

rajesh sherla

+ Follow
since Apr 04, 2010
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by rajesh sherla

Tony Docherty wrote:The standard classloader (certainly up to ver 1.6, not sure about ver .7) does not support loading classes from jars within jars. There are class loaders available that do support this functionality and I believe some IDE's such as Eclipse can package jars in jars by providing such a classloader.
If your jar is working on Windows and not Unix it may be picking up the classes from external jars without you realising it.

Yes, you may be correct.
But m sure that in "Windows" there is nowhere specified to pickup the required jar files. Thus there is no way that java program(Windows OS) is picking up the jar files from external source.

Can you tell me about how to load the jar files within jar ?? i.e. which utility to use , any example etc....

8 years ago

I developed program which connects to database and uses ojdbc14.jar. I have included below mentioned entries in file :

Class-Path: lib/ojdbc14.jar lib/jxl.jar lib/poi-3.6.jar
Main-Class: com.xl.MainExcel

And the library files are included inside the "lib" folder in the newly created jar file.

Problem is, this program runs fine in Windows environment, but in UNIX environment, the same program gives exception "Class not found:"

Why so ???

Not able to figure it out. Can anybody help me how to run the same jar file in unix environment ??
Not only this other programs which requires external library files never work in unix machines whereas same works fine in Windows environment.

My requirement is, if my program requires any external jar file then i should not tell my client to include those files in respective directory, the jar file which i will be providing should run fine with the help of enties.

8 years ago
Hi Campbell Ritchie,

You are correct. Thanks for this.
I tested my program in *nix console, it moves cursor to the start of the same line.
But the same progarm in *dow console, shows proper output.

But just in general question, you said "System.out.printf("0x%02x ", (int)c);
Then you will have definite confirmation the characters are coming back correctly when you get 0x0a for \n and 0x0d for \r"

I checked on *nix console, it is showing me "0x0d" during serialization/deserialization process.
So it means everything is fine..

And for confirmation every time we have to use System.out.printf("0x%02x "...) ???
9 years ago
Hi Udhaya,

Can you be little more specific to your issue.

Because i created one String object with newline characters "\n" and also with "\r" as given below

String s = new String("string1 \n string2");
String s1 = new String("string1 \r string2");

During deserialization, both the output is proper as given below


How you are inserting new line character in object.
9 years ago
yes, i changed my image file type from bmp to gif, then it worked.
Also jpg file type is also working fine.

But image file with extension "ico" (icon type) and "bmp" (bitmap type) are not working.

Is there any specific reason for this ???

9 years ago

Myself also facing the same issue i.e. icon image is not getting displayed on System tray.
I have written java code as follows:

return (new ImageIcon("flower.bmp","tray icon")).getImage()
return (Toolkit.getDefaultToolkit().getImage("flower.bmp"));

Also i tried with below code:

URL imageURL11 = ClassLoader.getSystemResource("flower.bmp");
Image image = Toolkit.getDefaultToolkit().getImage(imageURL11);

return image;

But none of them showing me icon on System tray.

Rest of the program is working fine.

9 years ago
Hi All,

For integer if i want to specify hexadecimal number then max length can be 15 digits only.

And i want to specify Octal number then max length can be 21 digits only.

Can anybody tell me how internally java convert input number
option1) hexadecimal -to- binary
option2) octal -to- hexidecimal -to- binary

Because for integer we can have upto 16 bits, so hexadecimal 15 digits is valid because 2^4=16 i.e 4 bit is used to represent one value.
For Octal we can have upto 21 digits, but with 3 bits we can represent 1 value. Is Octal is converted to hexadecimal and then to binary ???

Can anybody tell me in which way number system conversion is performed in java.

Thanks in advance
9 years ago
OK I agree whatever is said.

I know to write anything in Java, simple plain English is used.

But From one of the Sun vendor, they had given that JVM is written in ANSI C and javac(java compiler) is written in Java.

I clearly understand that JVM implementation is confidential. But what about java compiler.

Is there any Specification for Java compiler ??
10 years ago

I want to know in which programming language Java is written ??

Correct me if i am wrong for below findings :

JVM is written in ANSI C
javac is written in Java language.
10 years ago