Downloading Eclipse Platform Source Code - java

Before this question is blocked for duplication, I would like to say that it is more specific than Downloading Eclipse's Source Code and Downloading Eclipse Source Code and Eclipse source code download , as well as they do not provide I clear way to download the code.
I need to analyse the eclipse source code through metrics more specifically the platform source code. First of all, I would like to know which are the packages that composes the Eclipse platform. Next, I need to download the platform source code, however I already tried different approach with no success. The ways that I already tried:
1) First, I tried to download the RCP SDK from (archive.eclipse.org/eclipse/downloads/), however, there is only a set of .jar files inside.
2) When I select the package related to platform (git.eclipse.org/c/?ofs=350), and next select the branch (for example, R2_0_1 ), the tree tab shows that it has only one .java file in the src folder (for example: http://git.eclipse.org/c/platform/eclipse.platform.git/tree/platform/org.eclipse.platform/src/org/eclipse/core/launcher?h=R2_0_1).
3) I also tried to get it by cloning the git repository as suggested by eclipse website (http://projects.eclipse.org/projects/eclipse.platform/developer), the same problems happens, there is only one .java file when you select src folder.
4) I tried to identify the packages which compose the eclipse platform by analyzing the Bug repository (http://bugs.eclipse.org/bugs/buglist.cgi?bug_status=all&content=platform&limit=0&list_id=10384608&product=Platform&query_format=specific). However, there are some components listed in the bug repository(such as,
eclipse.platform.common.git, eclipse.platform.git and eclipse.platform.news.git) that are not listed here (git.eclipse.org/c/?ofs=350). This way, I`m not able to identify which components compose the platform.
This way, I would like to know if is there any way to download the Eclipse Platform source code and identify its packages.
Thanks in advance.

Related

How to include Javadoc in a library JAR?

I'm currently trying to write my first own library. It's just for testing, I want to find out how libraries are written, compiled, distributed and used in order to prepare for some upcoming personal projects.
Yet, what really causes me to wonder, is why exactly my Javadoc isn't compiled with the Library. I know that comments and annotations are not compiled, but for example the JDK (which is basically a huge library) comes with a working doc as well.
I've tried to compile a JAR (libraries aree normally JARs, right?) from not the compile output, but the sources (so I had a JAR of .java files), but this failed to be included in IntelliJ. I could add it as an external library, but neither did it show up in my explorer, not could I import or use any of my classes.
I know there must be a mistake somewhere here, all libraries I've ver used, whether it was Java, C# or whatever else always came with a working documentation (IntelliJ shold show that on mouse hover), and I'd like to know how to correctly build a library that I can share with a team partner, so he just needs to download it, add it as a library in IntelliJ and has all the functionality, but also the documentation.
Thanks to everyone in advance!
Because it isn't needed, and would bloat the file size of the executable. If you have a library in C or C++, the documentation may be bundled in a zip file, but you won't find it in the compiled .so or .dll. One just holds the binary and resources needed for the project. The .jar is equivalent of that- it's the compiled output. Documentation is hosted/downloaded separately.
When you download the JDK, you're not just downloading a giant .jar. It includes other things, like documentation in the download.
I'd like to know how to correctly build a library that I can share with a team partner, so he just needs to download it, add it as a library in IntelliJ and has all the functionality, but also the documentation.
The short answer is that you provide your team partners with your project source code as well as the binaries. They then can configure their IDE (Intellij, NetBeans, Eclipse, whatever) with the location of the source code and the IDE will be able to extract the javadoc comments on the fly and render them as requested.
Sharing the source code also has the additional benefit that your partners can debug their (and your) code better. By themselves, javadocs are rarely sufficient for debugging complicated problems.
Alright, if everyone ever has this probelm again, here's a complete tutorial:
As #Gabe Sechan already said, the Doc is not compiled into the JAR for some valid reasons. Instead, I recommend you to add the following to your JAR:
module compilation output
content of "src" directory / alternatively: module sources
Build --> Artifacts --> All Artifacts.
Now, if you add your library JAR into a project, it will show "Classes" and "Sources" in the right tab, as IntelliJ automatically recognizes you've bundled both into the JAR.
Now, IntelliJ should show your documentation, as it lives within the source files.
If, for some reason, IntelliJ switches from its "fancy" documentation popup to unformatted plain text, proceed as follows:
Navigate to File -> Settings -> Advanced Settings, and in the 5th block, where it says "Documentation Components", just tick everything you find. That's gonna fix it.
Thanks to Gabe Sechan again, your answer helped me to understand what won't work, and finally I've found a way to make it work myself.

Eclipse not recognizing changes in code

A friend and I are working on a java project in Eclipse. Whenever we "ship" a new version we export it to a runnable jar.
It seems whenever we try to send the file back and forth (over google drive) to work on separate parts of it something gets messed up. This doesn't happen for him, but when I download the file from Google Drive, Eclipse does not recognize any change I make to the src.
It doesn't matter how many times I change the workspace, move/ rename the file, clean/ build the project. Nothing seems to be solving this problem. Any advice on why this is happening and how to fix it?
It would be infinitely better for the both of you if you looked into some kind of source control system, as opposed to a file sent through a file sharing service.
Sharing the source code in a JAR doesn't allow you to:
Keep a revision of known working code, in case something breaks
Reliably import the code
Keep track of changes (who did what to what file, etc)
Look into something that's suitable for sharing between users. GitHub and BitBucket both offer free Git hosting, which is a very popular source versioning tool.
Eclipse is probably building the new version of the runnable JAR in the project's output directory, which by default is something like %PROJECTDIR%/target. The new version of the JAR with your changes will be there, and you'll have to export them again to trade files back again. See also: How do I change a Java project's bin folder in Eclipse?
it is probably because it is not updating yours .class, try delete .class of "target" folder of your project, make clean (project - clean) and save again the changes
There are many steps where you can solved it,
Clean Project and Re-Build
Remove .metaData and .settings from Workspace
Clear cache
In my case, I have tried much more and I got to resolve it by removing Classes, test-classes folders if Its there in Target folder

Maintaining Eclipse project include/lib paths in CVS

Background:
Here at the office my group uses a common linux environment where we do our code development. Our code is kept in CVS. The latest releases of our various libraries are kept in a specific directory (ie /data/group_projects/lib). Our Makefiles/Ant builds all specify what libraries are needed. We use autoconf to create the makefile after checkout for most C/C++ projects. We've just got Eclipse (3.4) installed and are planning to incorporate it into our workflow.
Problem:
So, when I check out a project from CVS through the Eclipse interface and then I have to set up all of the library paths (and include paths for C/C++). For some of our projects, this could be a lot of work. Is there a good way to save these paths along with the code when I check it back into CVS?
Ideally, when the next person checks out the code in Eclipse, the paths (and anything else they might need) will automatically be set up and they will be able to compile straight away.
Efforts:
I know that the include/lib path info is kept in a .cproject or a .classpath file (C/C++ or Java respectively). I thought I could export this info through Export -> Preferences. The resulting epf file doesn't have any path data in it unfortunately. I tried directly adding the .cproject file to one of my projects (so I could then put it into CVS) but Eclipse really doesn't seem to want me to do that.
I am quite new to Eclipse (esp using CDT), but maybe the necessary path info can be pulled out of build.xml/Makefile automatically by Eclipse? There seems to be a bit of a disconnect in Eclipse between the buildfile/makefile and the jar/include files that the IDE uses for checking your code as you type it. Maybe I am missing something?? I'm planning to put some serious time into researching Eclipse over the next few days so hopefully the inner workings will become much more clear to me.
I've asked the guys here at the office but no one is much of an Eclipse guru. My searches haven't turned up much . . I did see a suggestion to add all external jars to Java -> Build Path -> User Libraries under Eclipse Preferences. For us, each user would have to set this up once but afterward all of our java libraries would be available to whatever project we decided to check out. Unfortunately, it doesn't seem as though I can do the same thing for CDT.
What would you suggest? Am I missing a setting or function of Eclipse? Or am I going about this the wrong way? Please let me know what you think. I'd really appreciate it. Thanks!
You simply need to share the .project, .cproject and .classpath files through CVS. You can do this from the cvs command line, or select then 'Team/add file to version control'.
You don't need to add these files to the project explicitly: they are inherently part of it.
Obviously, if you do this, you need to make sure they are location-independent.
See:
eclipse wiki
Safari books
I've done this in Eclipse, and it's not too hard. You have to check in the .project and .classpath files. There are one or two places where Eclipse doesn't correctly automatically check out the files when you want to edit them, so when you get a read-only error you have to go manually do it, but for the most part it works.
The paths need to be all relative.
If relative paths is a problem, you can also take advantage of workspace variables in Eclipse. The developer sets their workspace variables appropriately on their machine (e.g., OPENGL_INCLUDE_PATH ), and then in the builder you can set the environment to pass that path along.

Eclipse: Is it possible to edit Java source known via source code "attachment"

I am using Eclipse 3.4.2 to develop my code. As part of my project definition I reference a utility library to which I have attached the source code. So far, so good - I can see that source when I bring up classes from the library and while I am debugging.
Now however I would like to make a change to one of the classes while still retaining all the features of the Eclipse Java editor (specifically things like tool tips and quick fix). These features seem to work when I'm viewing the source (I can CTRL+LClick through method names for instance), but it is read-only. On the other hand I can explicitly open the source file which will allow me to edit it, but I lose all of the "smart" editing features.
I've recently switched to Eclipse from IntelliJ where this was possible so I'm hoping it is in Eclipse as well. Note that although I could simply include the code as a project in my workspace, I'd really rather not. The workspace is already quite large and I don't want to further slow Eclipse down by adding projects I rarely would ever touch.
I am not sure I get your question right. When you add a precompiled library to your projects build path (the JAR) and attach source to this JAR, Eclipse will show you the source code when you click on a .class inside the JAR. The same goes for the debugger, which will also allow you to step through the code lines in the source, if the classes in the JAR were compiled with line number information.
Now what you seem to want to do is modify the classes inside the JAR (the source view is just an overlay which can even be off, if you attach a different version of the source), which is not possible, because they are wrapped up in binary form in the JAR archive - even though Eclipse is smart enough to display them individually.
I guess you would expect your changes to be hot-swapped into the running program by the debugger. This can only be done through a recompile once you finished your changes. Usually Eclipse does that automatically when you save a Java source file. As your source file is however not part of the workspace (or an external folder explicitly declared as Java source) - it will not do that recompile and swap.
I'd recommend to include the source of your external library as a project in Eclipse and not worry about performance too much - I work with 3.4.2 every day and my workspace has about 45 open projects with several 10.000 classes and millions of lines of code. I assign a Gigabyte of RAM to the Eclipse VM and have no problems with that on a Core2Duo 2.6GHz machine.

Getting Netbeans and Subversion to play together nicely with libraries?

I'm having a difficult time figuring out how to add a .jar/library to a Netbeans project in such a way that I can get it committed to the repository.
The typical way to add a library (per the Netbeans documents I've already gone through) ends up with it just being local to me. Anyone who checks out my project ends up missing my required library.
Inserting it manually and trying to work around Netbeans results in Netbeans hanging while trying to scan the project...
So, how can I tell Netbeans to pick up a jar as a library and include it in my project in such a way that Subversion will be able to handle it?
There are a couple ways to fix this.
A. When you define your Library, use a path to a common location. A location that's identical on everyone's machine--such as the location of a JAR installed with a third-party app into Program Files or /usr/local/ works well or a network drive.
Then, when they check-out the code, the path will still be correct and they do not have to define the Library on their Netbeans workspace.
B. Edit your project.properties file to use a relative path. Open your project.properties file and look for "libs.LIBRARY_NAME.classpath=...". That will be the "default" location used if the Library is not defined.
Change this to use a path relative to your project and store the jar files in your project. For example:
libs.Log4J.classpath=lib/log4j.jar
Keep in mind that the Library definition in your Library Manager will override this value--so make sure you keep them in-sync (i.e. append a version number to the library name!).
C. Use Vincent's suggestion of using a build-system such as Maven. The Maven build-process will take care of downloading dependencies, etc. Netbeans has plugins for several popular build systems.
There is a new feature in NetBeans 6.5 (variable-based paths in projects) which should make this easier.
See http://wiki.netbeans.org/NewAndNoteWorthyNB65#section-NewAndNoteWorthyNB65-VariableBasedPathsInJ2SEJ2EEProjects for details. Note the screenshot includes variable references in the library customizer.
Not really an answer to your question but... generally you should not include these libraries in your subversion repository. There is usually no need to have them managed. What you might want is to set up a central repository similar to what happens with maven. If you use maven, you can create a local repository of libraries on a server accessible by the team. The dependencies on these libraries are entered in the pom.xml file and this is in the subversion repository. Now, as team members check out the code from subversion they all have access to the maven repository.
[I am looking for a reference to this right now. When I find it I'll edit this answer.]
I use NetBeans IDE 6.5.1 and the best solution I've found so far is to include the needed libraries from your local host and then change their paths to relative. After that you have to remove the libraries manually from the NetBeans file explorer, and then copy them from their OS location in your computer manually to the file explorer again. That way NetBeans detects the change and you can commit it to the repository.
Note: I Highly recommend to clean and build the project again after updating.
An easy way to pack up your lib/jars into your project so that subversion "just handles it" so you can grab it out with all the attached libraries ready to compile and go is to include them all under your project directory via the "shared libraries" option by managing the libraries folder.
When creating a new project you can specify "Use Dedicated Folder for Storing Libraries" and then use the suggested relative .\lib path. If you have an existing project, you can edit it's properties, Libraries Category, and Browse for a Libraries Folder. Again a first-time run will suggest .\lib and then offer to copy existing dependencies to that folder. These graphical actions should provide similar results to James Schek's 'B' answer.
Commit the project with the newly added libs in .\lib and you should be able to checkout and build from anywhere and know you'll have the same libs (at the same version) as you had when you last built and committed.
I don't know how long this feature has been in NetBeans. For more details see:
http://netbeans.org/kb/docs/java/project-setup.html#projects-shared-libraries
I ended up just downloading my own set and putting them on my local drive for this project. I setup my Netbeans to look there and warned the other guys what I did... Eventually, we'll have to do something a bit more scalable though... :-)
OK, the working solution that I've now moved to is to extract the class files out of the jars and dump them into the Source Packages area. Then it all gets committed to the repository and also avoids having to deal with handling a separate "lib" directory in the deployment phase.
This solution does everything I'm looking for, yet I feel real dirty about doing it this way. It just seems horribly broken and wrong... :-)

Categories