Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!

sopal Pal

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

Recent posts by sopal Pal

Hi

In my program I am making a call as

ClassLoader.getSystemClassLoader().getResource(fileName)


If I try the above method with the filename as
viewing.proprties and that file resides in

c:\program files\

Then

This is the error I get :

------- Error ----------

url = file:/C:/Program%20Files/viewing.properties
java.io.FileNotFoundException: C:\Program%20Files\viewing.properties (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at TestFile.getProperties(TestFile.java:79)
at TestFile.main(TestFile.java:19)

--------------------------


** ANY IDEA How to resolve this

The code works fine - if there is no SPACE in the directory.
Is there a way to get around this issue

Thanks
12 years ago
Here is a description of what I need to do

1. Using a Swing Application - I want to run Ant using a build.xml file and run Target1

2. Get the result output from Target1 - and if did not fail - do something else.

How do I go about using the ANT API to do this.
Any help is greatly appreciated
12 years ago
Ok, so my guess was right.

Now, if I load 100,000 instances of a Class file - which was compiled WITH Debug Info - is more memory in the JVM HEAP consumed than - if I had loaded 100,000 instances of the same class - which had NO debug info.
13 years ago
I compiled a class first with no option

javac Vertex.java --- File Size - 887 Bytes

Then I compiled the same class as

javac -g:none Vertex.java -- The File size was - 667 now.

However, when I did

javap with each of the above class files - each of different sizes, the generated output is the same.

Why is this so ??

Are the extra bytes - when the class is compiled with Debug On - just debug related info and nothing to do with actual Instruction/ByteCodes
13 years ago
Hi
If I compile a Class with Debug turned ON the size of the class file is larger than when I compile the class with NO Debug info.

Does this also mean - when a class compiled with Debug info - is loaded into the JVM - it takes that much more memory than its counterpart class - which is compiled with NO Debug.

Any help would be appreciated.
Thanks
Sumit
13 years ago
I have made my own notes.
Please send me an email at palsumitpal@hotmail.com and then I can mail it to u
13 years ago
Isn't it strange that array indices cannot exceed the int limit.
So if I need to have an array whose size is greater than int ( max ) my only alternative is to use linked list kind of things - right ?
13 years ago
Hi
I have this simple program

=====

public class Hello
{

public static void main(String[] args)
{
long size = 123456789l;
int arr[] = new int [size];
}
}
=====

Why does the compiler give the error

Hello.java:7: possible loss of precision
found : long
required: int
int arr[] = new int [size];
^
13 years ago
the .cgi program is on the Solaris JDK - but I am still looking for the .exe for Windows.
13 years ago
because the code is not being downloaded for u. It can be found in its local classpath
13 years ago
A security manager is required in any JVM that needs to download code, and RMI clients need to download RMI stubs (as well as any other custom classes or interfaces needed to communicate with the RMI server).
13 years ago
I could not locate the - java-rmi.cgi - in the bin or jre/bin directory.
Is it something that needs to be downloaded separately ??
Please let me know.
Thanks for your time
13 years ago
Hi
I am looking for a tool that can show me the full object model given a jar file ( containing the classes etc ).
Is there something like this available.
I am using IDEA and it seems to show the hierarchy of only 1 class at a time.
Given a .jar file, I am looking for a tool that can document all the classes in it and their individual hierarchies etc.
Thanks for your time and help
Hello

Happy New Year to everyone. I cleared the SCEA with 84% in Dec 2004.

I have visited this forum on numerous occassions and got wonderful feedback and ideas that not only helped me with my Assignment, but with the general concepts and fundamentals.

The journey of doing the SCEA in itself was exhilarating, and though I will not dare to consider myself a full fledeged Architect just based on clearing an exam and a few projects, but this was a good headstart and I think I can label myself as a budding J2EE Architect with an idea to keep learning all the time on all projects.

I was particularly impressed with books like - J2EE Design Patterns by Alur, Crupi, Malks and
J2EE Design and Development by Rod Johnson.

Wishing u all good luck for the exam.

Sumit

** I had made a mistake in one of my image files when I submitted the assignment. However I discovered it before the Part III - while I was revising my solution and immediately contacted the Sun Exam personnel and through email I resolved my problem and they allowed me to upload the exam again.
Thanks for the info. I already did that and explained it to them. They have given me the permission to upload the Assignment again.
Also I had mentioned this issue in my Essay exam in Part III and as a side note to 1 of the questions, explained in text what the sequence diagram which was missing did