2

Possible Duplicate:
Where can I find JavaEE packages' sources?

I downloaded the Java EE 6 with Glassfish server from Oracle's website. Then I created a Java EE project in Eclipse. But I wasn't able to find the source code attachment when I click "Open Declaration" on a Java EE class in Eclipse.

It says "Source not found" for Java EE classes in the class file viewer. I can, however, find the source code for Java SE classes from the installed JDK directory in glassfish3/jdk/src.zip. But for Java EE API, I couldn't find the source code zip file from the downloaded Glassfish JDK directory. Any suggestions?

Community
  • 1
  • 1
tonga
  • 11,749
  • 25
  • 75
  • 96

1 Answers1

1

The source code for glassfish is on the main glassfish download page for example http://download.java.net/glassfish/3.1.2.2/release/glassfish-3.1.2.2.zip

Once you navigate to a class and eclipse tells you it does not have source you can click on the locate source button and navigate it to the zip file.

Update my mistake the above link was the binaries, it looks like the source has to be obtained directly via checkout from subversion you can find the correct branch to checkout here http://java.net/projects/glassfish/sources/svn/show/tags you need to look at your startup log or use asadmin version to figure the build number so you can chekout the correct source tree. once you have checked out the correct source tree then you can point eclipse at it.

see this blog for more details http://amitstechblog.wordpress.com/2011/04/29/glassfish-source-code/

ams
  • 60,316
  • 68
  • 200
  • 288
  • I used the following link to download the source code from SVN repository: https://svn.java.net/svn/glassfish~svn/tags/3.1/ I put the download in a folder glassfish/src/ When Eclipse prompted me to attach source file, I pointed to the above source folder. But it couldn't find the source either. So how can I integrate the source code with Eclipse? The servlet, jsf classe source files were not found even after I pointed to the downloaded folder. I guess maybe I need a packed .jar or .zip file for Glassfish source files? – tonga Dec 17 '12 at 03:29
  • @tonga: I have the same issue - asked here : http://stackoverflow.com/questions/19733294/attach-glassfish-source-in-eclipse-which-folder-for-javax – Mr_and_Mrs_D Nov 01 '13 at 18:47