Ken Rubiniac

Greenhorn
+ Follow
since May 14, 2004
Merit badge: grant badges
For More
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 Ken Rubiniac

Marco,

Thank you for your response. You replied:

I simply downloaded the J2EE 1.3 JDK, and unzipped it under a folder, and declared a J2EE_HOME variable pointing to the installation folder. The J2EE 1.3 package, when unzipped, contains a j2ee.jar under the /lib folder. You should find the same.

I cannot find anything specifically for the J2EE 1.3 JDK on the Sun Site.
Can you give me an url for Windows XP?

I took the following steps below:

When I go to Sun's site, I go to this url:
http://java.sun.com/j2ee/download.html It mentions only the J2EE SDK not J2ee JDK, so I
go to the following URL:
http://java.sun.com/j2ee/1.3/download.html#sdk

I chose the following link: Sun ONE Application Server 7
I ended up choosing the link: Sun Java System Application Server Platform Edition 7 Update 4

I tried to unzip this and find a bunch of zips within the zip file, but no
j2ee.jar in lib. (This download is for Win XP). There was a jdk.zip, but no j2ee.jar in it.

Thank you for hearing me out,

Regards and Thanks,

Ken
Hello,

I am trying to compile the classes on p.30 and get an error for not
finding package javax.ejb.

My compile command is javac -classpath ..\lib\j2ee.jar -d ..\classes headfirst\*.java

My download is Sun Java System Platform edition 7 update 4.
The file sun-appserver7-win-ur.zip is 233MB. I downloaded only the server component. I found a file j2ee.jar.pack doing a system search, but not j2ee.jar. I renamed it which could be plain wrong.

My environment variables are:

PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\PROGRA~1\ULTRAE~1;C:\Program Files\Symantec\pcAnywhere\;c:\j2sdk1.4.2_04\bin;C:\ant\apache-ant-1.5.3-1\bin;C:\Sun\AppServer7\bin

JAVA_HOME=c:\j2sdk1.4.2_04
J2EE_HOME=c:\Sun\AppServer7
CLASSPATH=.;\projects\advice\classes\headfirst\;c:\Sun\AppServer7\lib\j2ee.jar

For those who found j2ee.jar, what did you do different from me?

Any help would be greatly appreciated.

Thank you,

Ken
Hello,

Help !!
I downloaded a Sun ONE Application Server 7 from Sun and cannot
find the J2EE.jar file needed for compiling code on p.30 of Head First EJB.

Any suggestions?

Thanks!!!

Ken
posted August 22, 2004 12:21 AM
--------------------------------------------------------------------------------
Hello,

I'm having some frustration compiling the client on p.57 of Head First EJB.

I confess that I have a J2EE 1.4 configuration, not 1.3, but will study from the exam from the EJB 2.0 spec.

When I compile,it cannot find javax.ejb.My environment vars are configured as follows:
PATH=C:\Sun\AppServer\bin;C:\jwsdp-1.3\jwsdp-shared\bin
JAVA_HOME=c:\j2sdk1.4.2_04
J2EE_HOME=c:\Sun\AppServer
CLASSPATH=.;\projects\advice\classes\headfirst\;c:\Sun\AppServer\lib\j2ee.jar

I am not feeling Wickedlysmart just yet . Can someone please help.

Thank you!!!,

Ken Rubin
SCJP
Hello,

I'm having some frustration compiling the client on p.57 of Head First EJB.

I confess that I have a J2EE 1.4 configuration, not 1.3, but will study from the exam from the EJB 2.0 spec.

When I compile, I cannot find javax.ejb.My environment var are configured as follows:
PATH=C:\Sun\AppServer\bin;C:\jwsdp-1.3\jwsdp-shared\bin
JAVA_HOME=c:\j2sdk1.4.2_04
J2EE_HOME=c:\Sun\AppServer
CLASSPATH=.;\projects\advice\classes\headfirst\;c:\Sun\AppServer\lib\j2ee.jar

I am not feeling Wickedlysmart just yet . Can someone please help.

Thank you!!!,

Ken Rubin
SCJP
Hi Deyaeddin,

I found an interesting article at:
http://www.csc.uvic.ca/~mcheng/360/notes/simpleRTJ/GarbageCollection.html

I talks about garbage collection of the string buffer constant pool when it fills up.

Regards,

Ken
I feel somewhat uncomfortable in the use of the word "object" in this context. I don't feel that "xyz" was ever an object in the sense described in the "exam watch" paragraph on page 20. It was never instantiated.

I don't really feel that placing a string in the String Constant Pool is equivalent to creating an object with "new". There again, these are the people who wrote the exam, so if I'm asked in the exam, I most certainly *will* feel that the two things are equivalent.

Hi Kieth,

I see what you mean when you compare strings to putting objects on the heap,
specifically the exam watch on page 20. Strings are an exception to the rule,due to their immutablility.You just get 1 unique string ie. "abc"
in the string constant pool. It can have lots of references.


Yet every time you do a new for string "abc", you get a new string "abc" in the non-string buffer pool(heap). The 1 unique "abc" in the string constant pool still remains.
One more though Kieth:

In a sense the "xyz" from the sting buffer pool is lost, but if you
refer to it with String w = "xyz", (a new reference later in the code) the same "xyz" string will be referred to since it is immutable.

Ken
posted May 23, 2004 02:04 PM
--------------------------------------------------------------------------------
The line below appears in a question in the Study Guide asking how many objects are created in the code example.

13. String x = new String ("xyz")

The answer to the question gives this explanation:

... Line 13 creates two String objects, one referenced by x and the lost string "xyz"

My initial thought was that the object referenced by x *is* "xyz", ie. that there is only one object created.

I understand that, because of the immutability of Strings, concatenation etc. creates new objects. But in this example, it appears that a single String object is being created and assigned to the reference variable x. why does the answer say that "xyz" is lost? And if "xyz" is lost, what is the "one referenced by x" that the answer talks about; what does x refer to?

Thanks,
Keith

Hi Kieth,

I came across this issue in the Kathy Sierra and Bert Bates Book , Java 2 Sun Certified Programmer Exam, during my preparation for it:

If you say String s ="abc", This means one string will be created in the string buffer pool.

In your case when you write String p = new("bdf"), "bdf" will be placed in
the normal (non string pool memory) and also in the string pool memory. So
we have two strings. The p reference will refer to the "bdf" in the
non string pool memory. Two strings are created because of the new().

I hope this helps. This is on page 360 of the book mentioned above.
The best book to study from is the
Java 2 Sun Certified Programmer and Developer. The authors
are Kathy Sierra and Bert Bates. You may even meet them on this
message board. The ISBN number is 222684-6.

I knew no Java and used this book and passed the exam by a good margin.
I had 10+ years of 'C'.

I also found Sun's practice exams very helpful. I didn't absolutely need
them to pass, but they gave me some confidence. They were atleast as
hard as the exam.

The questions in the book were similar in hardness to the exam.

Good luck,

Ken