JCodec: FrameGrab8Bit.class not included in JAR download - how do I add it? - jcodec

I just downloaded the latest version of JCodec: JCodec-0.1.9. However, I noticed the manifest doesn't include FrameGrab8Bit.class. As Picture has been deprecated and supplanted by Picture8Bit it would be nice, and almost necessary, to have access to the methods of FrameGrab8Bit. As the file is not included in the JAR, I was wondering how I could easily add the mising file to the JAR (I'm using Windows 10), or if there is another way I could add the file to the project.

Related

NetBeans Include External JAR in Export to Zip

I have a NetBeans project that uses the GSON library. I've tried including the GSON.jar file without requiring future users to separately download it. However it doesn't seem to work. The project looks for the file from the relative path of my computer so the file isn't found on another user's computer. Is there a way to include GSON.jar and "Export to Zip" and keep the reference in the project itself? I'm lost!
Thank you
Exporting a Project to ZIP zips up the project folder only, and not anything outside of the folder, including dependencies. If you include the GSON.jar file in the project folder, then the JAR file will be included in the .ZIP file. It's a good practice anyway since NetBeans will use a relative classpath and thus if you move the project itself NetBeans won't give you an error message when loading the project.

JavaFX FXML 2.2 - Deploy Application with bitmaps

I have searched a lot and tried several ways to do this, but am stumped. I am writing a desktop app (though I suppose it could also run in a browser) that allows an Android programmer to edit all of their dimens.xml files at once. I have created my own images to use in ImageViews as buttons. I am using different methods to access these images:
Some are referenced in the FXML file, like <Image url="#Icons/ic_launcher.png" />. The path is "src/Icons/". The path of the FXML file is "src/application/xxx,fxml".
Some are referenced in the css file, like "-fx-image:url("QuestionMark.png");". The css file and png file are in the same directory "src/MessageBox/"
Some are changed dynamically at runtime:
ImageView mButtonIcon = new ImageView("/insert_item_above.png");
The path of the image: src/
The path of the class: src/ContextMenuButton/
The above only works in Netbeans 7.4. None work when I run the app in Eclipse.
If I go to the dist/ directory and run it from any of the 3 methods, I see my images.
If I move the dist/ folder somewhere else, the only way I can get it to work is if I copy the src/ folder to the same directory and delete everything but the png and css files. So, I end up with:
+ F:/AndroidDimens
+ dist
xxx.jar
+ src
insert_item_above.png
+ Icons
ic_launcher.png
+ MessageBox
QuestionMark.png
So, the jar file has modified all of the paths to be relative to the src/ folder. My goal is to make the paths relative to where the jar file is. I tried to place the images where I would not need project related paths. But it must have made the paths something like "../src/MessageBox/QuestionMark.png" in the jar (relative to the project's dist/ folder).
Is there any way to fix this? Ideally, I would like all images to be in one directory. Then I could zip that directory, and someone else could just unzip it and run the app.
Thanks!
EDIT
Thanks to #jewelsea (in chat), I found that the problem was due to having an older version of JDK 7u13 installed with the latest one needed for JavaFX 2.2. Deleting the old version, and updating global variables that referenced it, solved the problem. No changes were needed to the default project settings.
Packaging Advice
Package all of your application's runtime class files and resources (fxml, css, png, etc) in the application jar file using the JavaFX packaging tools.
Using the JavaFX packaging tools is what NetBeans 7.4 does automatically during it's build process for JavaFX application projects.
Eclipse and other build environments will not use the JavaFX packaging tools automatically. I believe, if you use Eclipse with the recommended e(fx)clipse extension toolset for JavaFX development, then that toolset will, through its UI, provide you with the ability to use the JavaFX packaging tools to package your application.
There are 3rd party packaging alternatives for JavaFX such as the JavaFX Maven Plugin or the JavaFX Gradle Plugin which will also package your application correctly.
Whatever packaging tool you choose, test the packaging process by unzipping the files from your resultant jar and checking that all of the resource files (fxml, css, png, properties etc) are where you expect them to be in the jar's internal directory structure. This unzipping process is just a developer sanity check, you don't need to ask your end users do perform such an extraction.
Your end users can run your application as either an installed native application (JavaFX term self-contained application) or as a click to execute jar file (JavaFX term standalone program) and all of your application's resources will automatically be available from the packaged application, with no additional work required by the user.
Resource Access Advice
I advise not referring to a src path in your code (as you won't have a src path inside your distribution jar), css or fxml files, but instead refer to those paths relative to the root of the distribution jar or your JavaFX application class. For example, to load a scene style sheet in a JavaFX Application subclass, use a form as recommended by the JavaFX deployment guide - 3.3.4 Loading Resources:
scene.getStylesheets().
add(this.getClass().getResource("my.css").toExternalForm());

Replace a gwt generated jar with a newer version

I've developed a GWT+GXT based web application. Recently we run into an issue that I was able to fix easily.
However when I generate the jar file from the tag, including the backport of the fix, even though I replace the old jar with the new one the fix has no effect.
On the other end if I generate the whole WAR everything works fine, but because of the size of it i'd rather like to be able to provide the patch as a jar file.
Am I missing something?
Thank you in advance
The jar file only contains Java sources and compiled Java - when you compile GWT, that produces JavaScript. This is what the war file contains, in addition to all of the other contents. In order to properly update your application, you need to update the compiled JavaScript.
The easiest way to do this, as you've noticed, is to replace the entire war file. If you want to keep the changes to a minimum, you could try just replacing the compiled JS directory and the jar file, but you'll want to be careful that you get the right directory - and all of the contents.

How to set reference to the folder which contains multiple jar files?

My environment:
Netbean 6.9.1
Glassfish 3.0.1
Windows 7
Goal:
When my coworkers opens the Netbean Project, the library is already referenced without them manually create library, adding jars into it and reference it.
Detail:
I created Netbean project and the project has reference to few jar files in the folder.
Currently whoever opens the project for the first time, they have to manually create library and refer it to the project.
My project location:
C:\Users\masatosan\Desktop\myProject\myApp
My library location:
C:\Users\masatosan\Desktop\myProject\lib\myLib
The myLib folder contains:
some1.jar
some2.jar
some3.jar
I can achieve my goal if I create reference to individual jar file by defining to project.properties file like below: (creating reference to sqljdbc4.jar)
file.reference.sqljdbc4.jar=../lib/sqljdbc4.jar
javac.classpath=\
${libs.restlib_gfv3ee6.classpath}:\
${file.reference.sqljdbc4.jar}:
But my case is different since I have 3 jars in the myLib folder and wanting to reference them all.
Is it possible to reference all jars in myLib folder?
Please let me know if you need more clarification.
I'm sorry, but it doesn't work that way. When you create a project, you have to add the jar files individually.
However, if you put your lib folder under your project, netbeans will refer to them via relative paths. Then when you share the project (lib directory included), netbeans will be able to automatically find the jar files when the next person uses the project. That way you only have to add jar files once.
Short of using a dependency management tool like maven (which Netbeans has good support for), this is really the best solution. It uses a bit more disk space (obviously), but that's never been a huge issue for me.
I figured how so let me share.
Tool --> Library then library window pop up.
Create library called "MyLib" which contains multiple jars.
Add "MyLib" to your project. This change will be written to project.properties file under nbproject folder.
project.properties file indicates the classpath of lib reference you just added.
It should look like something below
javac.classpath=\
${libs.Excella.classpath}:\
${libs.MyLib.classpath}
Now someone else opens the project from different machine and she just needs to do step#1 and #2, which is to create library with same library name i.e. "MyLib"
I think this is what Bill was saying originally but thought it would be helpful to give step by step instructions since I finally figured .... after long time :D

Difference between adding library and .jar file in NetBeans?

I have a .jar file of LWUIT, and it's also in there in the NetBeans library.
When I add it as a .jar file my programs run good and when I add it as a library my output is not shown correctly. What's wrong with this?
When added as a library, LWUIT is only available for your application to compile against. I assume LWUIT is not already installed on whatever J2ME-enabled device/emulator you want to run your application.
When added to your application JAR file, LWUIT is also available for your application to run against. Your application JAR file is presumably significantly larger then.