Where could one find the source attachments for Glassfish? - java

In my current project we use Glassfish, so we have org.glassfish.extras.glassfish-embedded-all-3.1.1.jar as a Maven dependency. This is all right so far, until I try to fetch the sources or the Javadoc for anything inside it using Eclipse.
As for the official Glassfish pages, both the Maven repo and the Java download page holds only empty jars (2KB) as source attachments.
I have managed to find the SVN repo for the project, but I can't help wondering why wouldn't there be valid and usable source jars in the official locations? What would be the canonical solution for this problem?

For study GlassFish purpose, let's read this tutorial:
Import from GlassFish project SVN to your prefer IDE:
https://svn.java.net/svn/glassfish~svn/
https://blogs.oracle.com/geertjan/entry/how_to_set_up_glassfish1
and result:
(Image credit: blogs.oracle.com )

Related

Finding source jar for binary jat

Example of situation. I use xercesimpl-2.8.1.jar in java project(Eclipse).
It's linked as a library. For debugging I downloaded xercesImpl-2.8.1-sources.jar.
I paired two these by:
Eclipse Project: Properties\Java Build Path\Libraries\Source Attachment
Browsing in source code for some type, them "Change Attached Source".
Both had no effect implying that 2 jar are strangers. However, reviewing of archive contents predicts they are similar.
Questions:
How (best practice) to find source for binary jar?
How to pair it in project?
What's in structure makes them able to pair?
Is it Eclipse or jre component that links them together?
Thanks in advance.
You should make your project a Maven or a Gradle project and define the Xerces library as a dependency. Then Eclipse or IntelliJ IDEA could get the source code of the dependency automatically, in case there is the source code in the repository. In most cases there is a source code in the repository.
For example Xerces:
https://mvnrepository.com/artifact/xerces/xercesImpl/2.8.1 (definition of dependency)
http://central.maven.org/maven2/xerces/xercesImpl/2.8.1/ (files in the repository)

Attach Sources - Maven Dependancies [NetBeans]

I am running NetBean 7.4 on Mac and I am sort of new to Maven dependancies.
I have been given a project that uses Maven to download a framework for networking simulation.
Turned out that the framework has a bug and the teacher gave us a public GitHub repository with all the source code for the framework, so that we can also modify it.
How do I connect the GitHub link (with sources) to NetBeans in order to being able to modify the framework classes? The "Attach Sources..." button that appears on the framework classes asks for a JAR or ZIP (if I download the ZIP from GitHub it doesn't work).
Moreover, it looks like the framework files in the Dependancies folder cannot be modified anyway (read-only files).
Thank you all.
to "connect" 2 different projects, the checked out source's version needs to be equal to the version in maven pom.xml.
So clone the github repository, figure out which branch/tag matches the version in your project and check it out. Then open the project(s). If you did that correctly (and assuming the github project is actually maven), your project's dependencies section will list them with project-like icon. Then the projects are linked.

Adding javadoc to a library included as .jar in NetBeans

I'm using Twitter4j for a Twitter Java client Java FX App. I downloaded the sources and included the .jar to NetBeans after going to: Projects->Libraries->Add Jar/Folder.
I'd like to include the JavaDoc for library but at site they only offer an html.
I've tried:
downloading the html and adding the folder as JavaDoc for that jar,
downloading and compressing to index.html and the downloaded folder to .jar
adding the URL
But got any good results. .
How can I achieve this?
On Maven Central, you can have the javadoc jar.
When listing the available files for version 2.1.4 there is a:
twitter4j-core-2.1.4-javadoc.jar
Netbeans should be able to download maven dependencies, including javadoc; at least, IDEA does.

How could I get Xuggler jars for Windows XP?

I could not find the jar file for Xuggler. How can I get them?
See Downloading & Installing. It describes how to get dependencies using Maven or Ivy. But you can also download these directly, the link is mentioned under Using Xuggler WITHOUT Apache Maven or Apache Ivy section. There is also a table below that section, which can help you pick the files you need for your particular architecture.

How to get Netbeans 6.5 shareable libraries working

I created a Web application in Netbeans 6.5. Now I want to use the Joda Time library. I want to share this library via subversion, because I don't want my team mates to be dependend on some Netbeans configuration.
Just to get the project working, I first added the library to the Netbeans library (Tools->Library). This worked OK. The JAR is added to the classpath, and is also deployed.
But when I create a shared library (via Project Properties->Libraries->Browse/New Libraries Folder), the JAR is not in the classpath. I get the error message package org.joda.time does not exist on the code import org.joda.time.*.
Any ideas?
What is the scope of this library? Is this library used for just this particular web-application?
If so, can we put the library in the WEB-INF/lib directory and check that into subversion as well?
Libraries in the WEB-INF/lib directory should be automatically added to the classpath of the project.
Here is what I did:
Tools -> Library -> New Library...
called the library joda-time
add added the joda-time-1.6.jar file to it
Project -> Properties -> Libraries
under the compile tab
Add library...
selected joda-time
(Edit, think I see the issue now - but perhaps not).
You need to add the library to the compile libraries AND add it to the distribution libraries. Or am I misunderstanding the question?
when creating a 'new project', there is an option to enable 'dedicated folder for libraries'. That way, the libraries will also be committed to the repository and your peer developer can checkout your project with all the libraries, your project has dependencies upon, thereby eliminating netbeans configuration bound.
In scenario where a project depends on JARs which can be placed in different locations for different users, a named IDE variable can be used.
http://wiki.netbeans.org/NewAndNoteWorthyNB65#section-NewAndNoteWorthyNB65-VariableBasedPathsInJ2SEJ2EEProjects
Another option would be to use the Maven plugin which already works quite well in NetBeans 6.5. A Intranet repository for the Artifact Jar files could be placed on a file server, or managed through a Maven Proxy like Nexus.
This blog entry describes a hack that worked in NetBeans 5. I don't know if it will work in NetBeans 6.5. I also don't know if this will work if you are building files nightly on a server.
http://blogs.oracle.com/gjmurphy/entry/using_netbeans_free-form_projects_as
I remember setting up shared libraries like this 8 years ago in JBuilder. I wish Netbeans had it by now.

Categories