• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A newbie needs help

 
Mike Minner
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am new to J2EE in general and EJB in particular (I have done a wee bit with JSP and Servlets). This is my first post so please...be gentle. I bought HF EJB two nights ago and am following along reasonably well. I'm into chapter four now. But, so far all I've done is read along, I haven't been doing the excersises (yes..yes..I know..do them). So, I went back to the beginning of the book to find out how to get the stuff from Sun to do the Advice Guy excersise.
Am I spelling excersise correctly? Looks weird to me.
Anyway, I'm running Mac OS X, and there is no J2EE listed at Sun for Mac OS X (just Windows, Solaris and Linux). But I notice that in the book, all the screenshots have a Mac OS X window title bar (but the DeployTool GUI is very un-Mac OS X-like, which leads me to believe that Virtual PC is involved or some other such shenanigins). I guess my question is: can anybody tell me how I should go about this? I have been doing the JSP/Servlet programming on my Mac, but I cannot find any reference to EJBs in my frameworks and APIs. So I don't know If I "have" J2EE already, or if I just got JSP/Servlet functionality through installing Tomcat.
Any help at all would be appreciated.
Thanks.
Mike
 
Bahadur Khan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike I suppose we should spell it like "Excercises"
And what you can do is download any industry server like Weblogic ( developer's trial edition ) or JBoss and you will get the whole environment for running EJB related stuff.
By the way, you said you are running Servlets/JSPs on you Mac OS, so this essentially means that you have JVM running and thats the key. If you can run a JVM then you can run enything related to J2EE on your machine.
try it!
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Mike!
- There's no specific J2EE distribution for OSX, but you can use the Linux one (J2EE 1.3.1). Just download it from sun and install it, and then you have to set environment variables.
I'm going to tell you *one* way to set it up that definitely works on OSX (including 10.3).
TO SET UP J2EE ON OSX:
go to java.sun.com and download the linux version of j2ee 1.3.1
It will automatically unpack itself wherever your downloads are set to go automatically. Put the directory (j2sdkee1.3.1) ANYWHERE you like. Just adjust your environment variables above to reflect where YOU put it.
For example, I put the j2eesdk1.3.1 folder in /Users/kathy/J2EEStuff/j2sdkee1.3.1
You need to set environment variables. If you haven't done this yet in OSX, perhaps the easiest way (assuming you're using the OSX default shell):
1) create a .tcshrc file, and save it in your main home directory (i.e. Mike, or whatever it's named. Mine is 'kathy', so that's what you'll see here). You need FOUR environment variables:
* PATH must include the /bin directory in the j2ee home directory
* JAVA_HOME is /usr (this is where your OSX J2SE lives)
* J2EE_HOME -- to whatever the top-level J2EE directory is (I never bothered renaming mine, so it's got the same name it had when I installed it)
* CLASSPATH has to include the j2ee.jar (in J2EE_HOME/lib/j2ee.jar)
Here's what I have in my .tcshrc (you can see that I have j2sdkee1.3.1 located in a directory I named J2EEStuff that's in my home directory 'kathy'
setenv PATH ${PATH}:/Users/kathy/J2EEStuff/j2sdkee1.3.1/bin
setenv JAVA_HOME /usr
setenv J2EE_HOME /Users/kathy/J2EEStuff/j2sdkee1.3.1
setenv CLASSPATH .:${J2EE_HOME}/lib/j2ee.jar
I think all you need to do it open a new terminal to have it work (I can't remember if you can do a source on this...). I don't think you have to re-log-in.
If you have problems with the deploytool GUI (like not all buttons show up, or something like that), you might want to change it from Aqua to Metal. You don't *have* to do this, but if you have trouble with it... here's how to do that:
CHANGING LOOK AND FEEL:
Here's what I did:
- in the directory /System/Library/Frameworks/JavaVM.framework/Home/lib
find and edit the file swing.properties (use pico or whatever editor you use)
Current entry:
swing.default=com.apple.mrj.swing.MacLookAndFeel
- you can comment that out with a # and add a new line that looks like
swing.default=javax.swing.plaf.metal.MetalLookAndFeel
So the final file will look like:
#swing.default=com.apple.mrj.swing.MacLookAndFeel
swing.default=javax.swing.plaf.metal.MetalLookAndFeel
Good luck!
Please let me know if you have trouble, and we'll walk you through it. I just installed Panther a few days ago, and it still works just fine.
cheers,
Kathy
 
Mike Minner
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the responses Bahadur and Kathy! I'm going to try Kathy's suggestions first (no offense Bahadur) because it seems to be more inline with following along with the book, and that's what I want.
By the way, it's "exercise"!!! Who knew?
Thanks again.
Mike
 
Mike Minner
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thanks, Kathy! Everything worked perfectly. AdviceGuy set me straight on my haircut. The only hiccup I encountered was that I had to change the order of the environment variable settings to
  • setenv J2EE_HOME /Volumes/HardDrive/mike/Applications/j2sdkee1.3.1
  • setenv CLASSPATH ".:/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/classes.jar:${J2EE_HOME}/lib/j2ee.jar"
  • setenv PATH ${PATH}:/Volumes/HardDrive/mike/Applications/j2sdkee1.3.1/bin
  • setenv JAVA_HOME /usr


  • Not sure why, but don't really care.
    Thanks!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic