How to add external Java libraries' folder to Jython project in PyDev? - jar

I am completely new to Python/Jython/PyDev.
I just tried to add a folder containing JARs as an External Source Folder to my Jython project as shown here: https://stackoverflow.com/a/12583946/2018047
Unfortunately, imports only resolved when adding the JARs individually (instead of their containing folder).
Do I have to add something like __init__.py files to those directories to make it work on a per folder basis? How are the init files structured?

Related

Can linter-flake8 ignore files by using a project-wide .flake8rc?

I'm using Atom and linter-flake8 for my project. I have a set of huge generated Python files and I want them ignored by linter-flake8. These files are placed in a folder called generated/, inside the project root folder. At the same level with the generated/ folder, I placed a .flake8rc with the following content:
[flake8]
exclude=generated/
and configured linter-flake8 to use this file (via Preferences in Atom). However, it still parses those files. What am I doing wrong?
PS: If I run flake8 --exclude=generated/ . in bash, in the project root folder, it works fine and ignores my files.

Add external jars to Eclipse plugin classpath

In the manifest file for an eclipse plugin its possible to add jar files and
folders to the classpath (on the Runtime tab).
In the root of my plugin I have a folder lib containing a-1.0.1.jar, b-1.0.0-SNAPSHOT.jar. But only when I select each jar separately:
Bundle-ClassPath: .,
lib/a-1.0.1.jar,
lib/b-1.0.0-SNAPSHOT.jar
...can they be used inside my project. Why is it not possible to add them to the classpath by adding the common root folder only:
Bundle-ClassPath: .,
lib/
?
No, you can't. Eclipse is based on OSGi, which is the platform providing MANIFEST.MF support to build plugins.
When you set values under Bundle-ClassPath, OSGi search into each one to find class files. So you can put folders containing Java packages and class files. When you put a jar file, it is uncompressed in memory and viewed by OSGi as a regular folder, still searching for class files.
Unfortunately, there is no way to load all jar from a folder. No wildcard mechanism or something like that is allowed here.

opening Flex project without .actionScriptProperties

I need to import a flex project into FlashDevelop.
However I am unable to find the .actionScriptProperties file.
How would I be able to import the project?
It would be great if someone could help me out with it.
Usually Flex Builder project contains:
src/ directory - source files (.as and .mxml)
libs/ directory - .swc files (if exists)
Usually FlashDevelop project contains:
1) src/ directory - place here files from src directory of FB project
2) lib/ directory - place here .swc files (if exists) from libs directory of FB project
3) on each swc files (if exists) you need make right click and select "Add to Library".
4) Make right click on main class file and select "Document Class"
This is main. May be there are other files. But I can not say what you have because I not know what files you have.
actually i canĀ“t import a FB project to FD whit the options in the menus but i can fix it creating a new project in the folder of the FB project and putting files in folders identified by FD it works for me

Eclipse CDT static resources under build folder

I'm building a C++ project under Eclipse and my release folder should include a static sub-folder with some files inside it, those are required by executable during runtime. The problem is that this folder is automatically deleted before every build - entire release folder is completely wiped out and I'm losing all the files inside it.
Solution is simple - need to place rm.exe from mingw utilites on path and Eclipse will delete only specific build files instead of removing entire release folder.

How do I create a jar file, which includes xml and html files?

I am trying to create a jar file which includes some class and java files needed, but I also would like to include some extra xml, xsl, html, txt (README) files.
I am using Eclipse on Windows XP.
Is there an easy way for me to set up a directory structure and package all my files into a jar?
Add the files to a source folder and they can be included in the jar.
One common way is to have, at the root of your project, a src folder. Within that, folders for java files, and others. something like:
src/
css/
java/
html/
images/
Then you can make each of those subfolders a source folder (Right click, Use as Source Folder) and they should be available to add to the jar.
A .jar is nothing but a ZIP archive, so you can use any program capable of creating ZIPs. Just make sure that you include the manifest and all the class files.
I just added all the files into my Eclipse project (including the txt, html, xml, etc files).
Then I used Eclipse to File->Export->Jar File->Next
Check the "Export Java source files and resources" box.
Done.
If you're using Ant, you can use the jar task (see the examples section for how to include/exclude certain files, etc.)
If you move to an ANT (or Maven, for you Maven fans) then you can automate the Jar building very nicely, and also use it outside of Eclipse (e.g., in an automated build environment). All you need to do is copy the files from your src, jsp, foobar and resources locations into a build staging folder, then Jar the resulting files using ANT's Jar task.
<target name="makejar" depends="compile, copyfiles">
<jar destfile="${jars.dir}/myjarfile.jar" index="true" basedir="${build.dir}" />
</target>
One thing I look down on is including non-source (except package.html files for Javadoc) within the src folder. If you feel you have to do this to achieve something, then you are doing it wrong.

Resources