ADempiere in Netbeans - Part 2
This blog is in continuation with the part 1 of the blog and explains how to compile and run ADempiere from Netbeans. Running and installing Adempiere in Netbeans is even simplere than project creation.
Setting the right JDK
As indincated in part 1 you need to run Adempiere on JDK 1.5. This may not be your default platform as many developers might be using the latest JDK. All you need to do to fix this is install JDK 1.5 (Refer part 1), and go to project view of adempiere, right click and go to Properties. Now go to Java sources classpath -> Manage Java Platforms -> Add platform and browse to you JDK 5 installation. Close the dialog box.
Now just select JDK 1.5 as the Java platform.
Dissecting build.xml
As you might know, the default build script in the main folder calls the build files in the subdirectories. The default target of the main build file is "complete" which depends on "build" and "install". The build target creates all the Adempiere jars by calling the "jar" target in all the subdirectories. The end product of the build target is the platform-independent, installable Adempiere zip file.
The "install" looks a bit messy, from the commented code it appears as though it was originally intended to launch "Run_Setup.sh" but currently it does not do anything more than unzipping the file created in the build process. To make the best use of your Netbeans development environment uncomment the following code in the "install" target:
<input addproperty="runSetupInput"
message="Run Setup(Y/N) ? "
validargs="Y,y,N,n"/>
<antcall target="runSetup"/>
Building Adempiere
Building Adempiere in Netebans is extremely tricky. Are you really ready for the challenge?
So here is what you need to do: Push the Clean and Build button!!! That's all to it.
Running and Installing Adempiere
Assuming that you uncommented the code in install target of build.xml, you can run and install Adempiere from Netbeans by simply associating your Run button in Netbeans with the install target.
Netbeans does not know which target to run when the "Run" button is pressed because the main build file does not have any target by the name "run". When you press the Run button for the first time, you will see a dialog box asking you to associate an existing target with the "Run" button. Choose "install" target there.
Now when you run the project you would be asked if you want to run the setup. Say 'Y' if you want to install from Netbeans. If you chose to install, you would get a the familiar Run_Setup screen as shown in the image below.
That's all folks.
I have follow your tutorial, but while run, i got like this, and not show anything
=======================================
Starting Setup Dialog ...
=======================================
The filename, directory name, or volume label syntax is incorrect.
ErrorLevel = 123
***************************************
Check the error message above.
***************************************
Make sure that the environment is set correctly!
Set environment variable JAVA_HOME manually
or use WinEnv.js in the util directory
***************************************
Press any key to continue . . .
Result: 123
runSetupInit:
runSetupNonWin:
BUILD SUCCESSFUL (total time: 1 minute 36 seconds)
i'm uing jdk_1.6.0._03
thanks.
Posted by onsir on May 23, 2008 at 12:40 PM TPT #
hi,
i try the seond run after pointing run to install it is not ask if i want to run the setup.
i'm using NB 6.1. did i miss somethink?
Posted by hks on July 05, 2008 at 10:53 AM TPT #
I had done checking out process and got AdEmpiere project in my NetBeans 6.1ML. Then I had choose JDK 1.5 as platform. But when I clicked CLEAN & BUILD project, 51 error messages and 66 warnings came up.
So, I changed java platform to JDK 1.6 and clicked CLEAN & BUILD project, amazing BUILD SUCCESSFULL. But when I run the project, I got similar messages as onsir.
Please Praneet, help me. What should I do?
Posted by fuad on July 22, 2008 at 02:53 PM TPT #
yes, you guessed it right
ADempiere has now moved to JDK 1.6. Apart from the platform changes, everything else remains the same.
Posted by Praneet on July 22, 2008 at 06:10 PM TPT #
Hks,
are you sure that you uncommented the code in build.xml?
Posted by Praneet on July 22, 2008 at 06:13 PM TPT #
Praneet, help me.
The error occur when i click Run..
What should I do ?
nstall:
=========== Install Adempiere
E:\syzuhdi\ZuhdiProject\Adempiere\trunk\utils_dev\build.xml:76: E:\syzuhdi\ZuhdiProject\Adempiere\trunk\install\build not found.
BUILD FAILED (total time: 0 seconds)
Posted by syzuhdi on July 24, 2008 at 10:43 AM TPT #
Can you double check if the Adempiere.tar.gz and Adempiere.zip files are present in E:\syzuhdi\ZuhdiProject\Adempiere\trunk\install\build ??
The build process should have generated this.
Posted by Praneet on July 24, 2008 at 07:09 PM TPT #