I'm trying to learn about debuggers in eclipse, and in this article:
http://www.eclipse.org/articles/Article-Debugger/how-to.html
They give a few sample plugins at the bottom that one can install and try out (the zip file on the bottom).
I'm not so familiar with eclipse plugins, and I am unsure as to how to install/view the source code of these jar files in eclipse. I have tried importing them into PDE and that has not worked.
Thanks for any help.
Unpack the ZIP file.
Unpack each JAR file into it's own directory with:
jar xf org.eclipse...jar
One of the unpacked files will be coresrc.zip, which contains the source for the core plugin, and one file will be uisrc.zip, which contains the source for the UI plugin.
Unpack those ZIP files somewhere
Import the directories created from the ZIP files as plugin projects.
This is not elegant, but will get the source into Eclipse.
It is quite possible that you will not be able to run the plugins, as they've been developed for Eclipse 3.0, which is about 100 years old and pretty much all interfaces have changed since then.
Related
I want to download the .jar file of a java framework.
That .jar should of course contain all the .class files that I need for my project.
I tried downloading from here:
https://mvnrepository.com/artifact/org.apache.camel/camel-core/3.18.2
But the .jar file is only 4KB big and contains only meta information, but no java classes.
I found jar files with java classes in them in older versions, but in newer versions they seem to upload only meta information.
So I don't know how to get to the .jar file with all .class files inside.
I don't want to work with maven or gradle for now.
And you can't just download jars with maven or gradle you have to build your entire project with it.
I also searched the github (https://github.com/apache/camel) and source code of the "Apache Camel" project and did not encounter jar files.
Is there any other popular place where open source java frameworks/libraries with jar files can be found?
The apache camel module doesn't contain any code. It just declares a list of dependencies, in the /META-INF/maven/org.apache.camel/camel-core/pom.xml file:
camel-core-engine
camel-core-languages
camel-bean
camel-browse
camel-cluster
camel-controlbus
camel-dataformat
camel-dataset
camel-direct
camel-directvm
camel-file
camel-health
camel-language
camel-log
camel-mock
camel-ref
camel-rest
camel-saga
camel-scheduler
camel-seda
camel-stub
camel-timer
camel-validator
camel-vm
camel-xpath
camel-xslt
camel-xml-jaxb
camel-xml-jaxp
slf4j-api
You have to download the jars that you need in this list of dependencies. All jars can be found on https://mvnrepository.com/.
This is why everyone will recommend you to use maven or gradle, as those tools will manage the dependencies for you.
I am currently developing a minecraft plugin that depends on other plugins to function. Shading the other plugins into my own plugin isn't an option since it is impossible to load three different plugins from within the same jar. That's why I need to do it like this. (Another option would be to just use some kind of maven API to download my library on runtime but I have no idea how to google for that)
There is a jar file in the resources of my plugin and I copy it to the outside using Files.copy(this.class.getResourceAsStream("myjar.jar"), new File("myjar.jar").toPath()) but when I try to load it, there's an exception thrown: java.util.zip.ZipException: zip END header not found. The jar in my resources directory is fine. I'm able to unzip it. When I try to unzip the file created by my program my ark (Linux zip viewer) complains about the zip file being broken. How can I copy the file without the file breaking?
If you have any idea how I can shade a maven wrapper or something in my jar to download the other plugin from a maven repository that would be nice too. I also somewhat tried to look up how maven repositories are built to kind of reverse engineer the maven dependency function but I gave up because I don't want to write my own sucky version of maven.
Thank you for reading my question.
I have a project where I want to add an external JAR file. The desired external JAR file has a nifty Github page with source, but no pre-compiled JAR file.
These are the steps I've completed so far:
1. I have downloaded the source in a zip. (its Twinkle from SwingFx.ch in case you're interested)
2. I have extracted the zip file to my workspace.
3. I have created a new project with the same name as the extracted folder from the zip file. (project loads the source successfully)
4. I select the export option from the File menu and selected the 'JAR file' option and clicked next.
Note: I had to add an external library to the above Twinkle project for it to build successfully (in case that makes a difference to the settings).
On the JAR File Specification page there are multiple check-box options available(see below):
Export generated class file and resources
Export all output folder for checked projects
Export Java source files and resources
Export refactorings for checked projects
Compress the contents of the JAR file
Add directory entries
I am not sure which are supposed to be selected and if it makes a difference in the behaviour of the project I will add the (soon-to-be) exported JAR file to. I tested it by exporting with the default settings. This worked ok.. However, I now do not know if I should have chosen different settings in case of any reasons I am not aware of. I am not sure if there are specific settings I should choose when I intend for the JAR file to, specifically, be added as an external JAR file to another project.
Please enlighten me!
This is a traditional Java library that uses Maven. It should be fairly easy to build using Maven, which should be better and quicker to build this, if you already have Maven and git installed.
Let's consider that you did not download the source file as a zip, but take the github approach, where you'd use git to download the source code.
If you don't have git, download its latest version and install it.
If you don't have Maven, download its latest version and install it.
Once Maven and git are installed, make sure the Maven and git binaries are configured in your environment PATH variable. If not set, you would, on the Windows platform and for Maven binaries, set it this way (using the default installation path):
set PATH=%PATH%;C:\Program Files (x86)\Apache\maven-3.1.1\bin
Create and change directory in a work directory of your choice, that we'll refer to %work_directory% from now on.
Run the following:
cd %work_directory%
git clone https://github.com/spreiter301/Core.git
git clone https://github.com/spreiter301/Twinkle.git
cd Core
mvn clean install
cd ../Twinkle
mvn package
6. Retrieve the twinkle-1.0.0.jar file in the newly created '%work_directory%/Twinkle/target' folder.
In this case, it was necessary to retrieve the Core library because it is a dependency of the Twinkle project. Normally, this is not necessary because dependencies are automatically retrieved from a maven repository. But in that case, that dependency is not available on any Maven repository. Hence we manually retrieved the dependency from github, compiled it and installed it in your local cached repository. Then we could package the Twinkle project into the JAR file.
This should do it. If you want a 5 minutes tutorial on Maven, there is a tutorial for this here. I highly recommend it, you will encounter this often in the Java world. Maven is the standard build tool for Java, just like 'make' is for C, 'rake' for Ruby, 'sbt' for Scala, etc..! Good luck with the rest.
So I am using
Eclipse IDE for Java EE Developers
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplerrc3
and I am trying to add the jasypt - 1.9.0 plugin to eclipse
Since I am not experienced in this, I only tried one way which is
1- Download the zip file form the following url
http://sourceforge.net/projects/jasypt/files/
2- Unzip the file into the eclipse subdirectory plugins
3- Restart eclipse
However it seems that there is something missing
Go to your downloaded file and go to the lib folder. In there, you have a whole host of jar files. It is most likely the jasypt-1.9.0 jar you want.
In Eclipse: go to: Properties > Java Build Path > Libraries
Choose to add an External Jar and navigate to the location of the jasypt-1.9.0.jar
This will add the jar and its libraries to your project. Note: Look at the API for what you are using if this doesn't work - you may require a different jar to be imported instead/as well.
This is the standard way to add any third-party libraries to your project.
I have installed Red5 server successfully and also am able to run the demos fine. Now, I want to create a sample red5 server application. I created a sample project according to the specific directory structure that Red5 requires. But, now when I try to open this project in Netbeans 6.8, I am unable to because both have a different directory structure. So, Netbeans doesn't consider it as a project. I actually want to convert this project to a war file, so I can deploy it to red5/webapps directory and then red5 deployer service can make project out it automatically. How do I convert this project to a war file? because in Netbeans I am unable to open it. Please help.
I don't know if this will fully answer your questions but this is my configuration.
In the main red5 directory there is a file called project.zip, you can open it to get basic configuration files, directories structure and build files for ant (Pure Java build tool).
Using netbeans, you create a new free-form project and point it to the directory of your project. because of the ant build files the project will be recognized.
Netbeans provides it's own ant version but i prefer to install and use ant from command line.
when you'll run ant in the project directory it will try to find dependencies and probably at first will complain that it cannot find ivy.
Ivy is a dependency manager that red5 project uses that can be found in the following URL: http://ant.apache.org/ivy/download.html
please notice that ant will tell you exactly where it searches for the required jar file, just download the ivy zip, unzip it, and place the jar inside it in the requested directory.
once ant will compile the project properly (just by running the commant ant), it will also create a war file under dist directory.
don't forget to add to your red5 netbeans project the relevant red5 jars in order for the project to compile properly.
I am also prefer use ant from command line. I have two directory structures. One for source files and another for deployment.
This example helped me to start.