Pentaho Kettle - Conversion of a job to jar file - jar

Is it possible to convert a pentaho job to jar file? if it so please tel me how? i tried to convert a job to jar but failed due to the class problems.

In JAR, we aggregate many Java class files. But in PDI Jobs, the files are in XML files. Pentaho uses its DI Engine to read these XML files. Hence we cannot create JAR files out of an XML file.

You can run an ETL job from java code, using kettle's api. You can't convert a job into a jar.

If you launch a job or a transformation in batch mode, you have to use the scripts kitchen or pan (with sh or bat extension dopending on the OS). Actually those scripts run a java program inside, using the parameters that you pass to it. One of the parameters has to be the path of the file .Kjb (extension of a job), which is a regular xml file. So the xml files are necessary, but you can launch directly the java command (the one inside of the sh/bat script) passing the required paramenters to it. To see which parameters it needs you will have to do a reverse engineering work on the kitchen/pan script, which are really simple and short inside.

Related

Opening/Editing Qt Resource File (.rcc)

I want to translate a program; but its language files (.qm) are in a .rcc file.
The program is not mine, so I haven't got any .qrc file.
Before asking this question, I have searched this site about this issue; but I don't attain anything.
Is there any way to extract/decompile it?
You can take my tool RccExtended - it based on the official Qt resource compiler with additional function to decompile binary resources.
Usage example:
cd \Path\To\MyQtResources\
rcc --reverse
Decompiler will unpack all .rcc files in the current directory, generate .qrc files and make.bat file to compile resources back to the binary format.
There isn't a supported way to decompile it as far as I'm aware, but it's a binary file format that can be read and handled. There's a nodejs example of how to read the file and extract PNGs on github: https://github.com/gcochard/png-extractor. It may be possible to extend that method out for the .qm files.
However there's other issues with attempting to add more translations to a Qt application without having the code, depending on the language you're attempting to add, how the developer has exposed the other languages etc.

How to make boxfuse create an image containing executable jar and configuration file to be specified in main arg?

I'm playing around with boxfuse attempting to "fuse" an image which contains an executable JAR. My executable JAR is given the path to a config file as an argument to it's main method, like so:
java -jar my-executable.jar -conf /some/path/to/my/conf.json
Where the file conf.json is read in by the JAR's process to be configured with e.g. port, database connection properties, etc.
I understand how to pass custom arguments using -jvm.main.args="-conf /some/path/to/my/conf.json", however, I don't know how to get the config file into the image itself. Obviously the path has to point to a valid file that exists within the image.
In dev, test and production, I would want to use the same executable JAR, but a different config file for each environment. I don't currently see a way around having different images for each environment. I see there is some support for packaging specific config with Dropwizard payloads, but no mention of something similar for executable JARs.
Is there a more general way I can package arbitrary files into the image, with predictable paths I can refer to in the jvm.main.args?
P.S. in my case the executable JAR happens to be a Vert.x application, but I think the general case applies.
What you can do is package the configuration for all environments (dev, test & production) within the executable JAR file. So you would have dev.json, test.json and production.json
You can then use a technique like environment detection with for example an environment variable to detect the correct environment at runtime and pick the correct configuration, which can then be loaded from the classpath instead of the file system.
This allows you to build both the jar file and the Boxfuse image only once and run it unchanged on all environments.
P.S.: I've just raised an issue for you to add first class Vert.x support in the near future to make things even easier: https://github.com/cloudcaptainsh/cloudcaptain/issues/28

Being able to run java application on different computers without JDK

How can I send my java application to a friend without having to send the entire project and being dependent on him having JDK? I'm aware of the .jar-file's existence, but I don't know how to proceed. I would like to be able to just send him the .jar-file or an executable file.
Any ideas?
Compile it to native code using a compiler such as http://en.wikipedia.org/wiki/GNU_Compiler_for_Java
Also, he doesn't need the JDK, just the JRE.
Did what #Barranka said regarding the dist folder, didn't know that worked until I read the readme file as #Barranka suggested.
So to quote what #Barranka said:
If you work with NetBeans, when you "build" your project, a dist
folder is generated, and your "packed" app is stored there. You can
send the contents of this folder. Read the "readme" file in that
folder. – Barranka
You can send the JAR file alone provided your program does not depend on other libraries. Assuming that there is a main() method and Main Class is configured in the JAR's manifest, the person can run it by Double Clicking (on windows) or use the command line
java -jar <jar_file_name>.jar
You cannot execute a Java application without a Java Virtual Machine, so you need one.
Your friend has to download a JRE/JDK, or you can provide it with your application directly as it (the JRE and your project in an archive) or provide it as a native compile code using GCJ or Excelsior Jet which will compile your application and a JRE.
As you can see the is no solution for your question, but there is one for your problem : ask your friend to download a JRE.

Want to Make a Jar file

I've made a java application(it extends JPanel) and want to make it into a jar file.I have BlueJ and I used it to do so but after I make the jar file it doesn't open. Can anyone help?
Jar files are PKZIP packaged files which have specific folder structure and convention in it. It contains the compiled version of your java sources (*.java -> *.class) plus meta data. You can "open" it with any archive which can handle zip files especially if you append the ".zip" extension to the file name.
If you mean executing your jar by "opening" it, that's a different thing. You have to have a standard static main method in one of your classes so the JVM can find the execution entrance point. If you have that you can say "java -jar yourjarfile.jar", which will execute your class starting from your main. Note, that I assume that you have JVM setup well (I guess you have) and your environment variables should be configured too. In most cases, your jar refers to other jar files. You can provide access for those for the JVM through classpath.
Do you use Eclipse to write code? If you do, then it is easy to use Eclipse to create an executable jarfile.
Do you use a JFrame to present your JPanel? If you do not, you may have a JFrame, it is the "application window" where the JPanel will be presented.
JFrame tutorial:
http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html
/Johan

Standalone HTML Application

Is there an application that can create a standalone HTA, which means no need 'mshta.exe' to run and not leaving any temporary files? i've try 'htaedit' but it need 'mshta.exe' and leave temporary files.
I don't think that hta can be run standalone. it is more of an interpreted language which is interpreted by mshta.exe. sort of like how java byte code is interpreted by the jvm
You could create a self extraction drive using iexpress.exe which :
zips a copy of mshta.exe and your hta file
unzips them to a temporary folder at runtime
and runs a specified command. eg : mshta <the hta filename>.hta
iexpress is commonly used to created quick and dirty installers.
I came to know of this process while finding a way to convert .bat / .cmd files to .exe

Resources