Java compile Action - compiling packages

Hi

Am exploring on FinalBuilder to automate the build process for Java Application.
I tried with Java Compiler Action, which compiles individual java files or n number of files in a folder, but fails to compile java files which form package…

Can you please tell me how to compile Java package (files are in different folder structure for package) ?.

Regards
Bhuvana

Hi

I have asked Angus to create an example project today that will demonstrate this (he has more recent java experience than myself).


Hi Bhuvana,

I’m attaching an example FB 4 project which compiles a package and then generates a jar file.

I put the code for compiling a package into an Action List called “CompileJavaPackage”. It uses a FileSet to find all the .java files under a particular root directory, then calls the Java Compiler with the correct options to compile a package. The example I’ve been using is the java2d package which is included as part of the jdk sample code.

The example is a little more complex than necessary because it loads the paths in a Prompt For Variables action, then passes them to the action list as Action List Parameters. Please let me know if anything doesn’t make sense.

(Note that I found a bug in the Java Compiler, regarding paths which contain spaces. We’ll have a fix out very soon, but in the meantime if any of the directory or class paths include a space then they will need to be put in quotes.)
Java_Package_Example.fbz4 (4.284 KB)

Hi Angus

Thanks a lot for your reply… but am not able to download the attachment…
can you please mail the same to bhoovi_s@hotmail.com

Thanks
Bhuvana

Hi Bhuvana,

Please try this test build if you need to work around the Java Compiler paths bug:


https://www.finalbuilder.com/downloads/finalbuilder/410/FB410_245.exe

Bhuvana,

Sorry, a bug in the forum software was preventing the attached project from downloading. Fixed now.

- Angus

Hi,

I am trying to compile java files using the %FileList% param to take care of package problem. Now I am getting parameter incorrect while trying to run the java compile action. I have noticed it works for file list with fewer files but throws parameter incorrect problem with all the files I need to compile. I could compile same number of files using javac compiler from a dos command line. Any ideas?

Hi Tareq,

Sorry to hear you’re having problems. Could you please email us your project and log files, to support at finalbuilder.com, for us to take a look at? Thanks.

Regards,

Angus

Can you repost that Java package example again? The link is dead.

Hi David,

Sorry about the dead link - fixed, please try again

.t8

Hi,

can you please repost the Java example?

I’m checking if Final Builder matches our organization needs and an example on how to compile file sets would be much appriciated

Thanks,
Eyal

Hi Eyal,

I’ve fixed the attachment link to point to the correct address, you can now download the example from:

URL: https://www.finalbuilder.com/forums.aspx?afv=topic&aff=1&aft=412&afpg=1

Regards,
Paul.