Script has different behavior on different systems

I have a default ant script for my netbeans java project and it works fine on my windows desktop, I got a dist folder with an internal lib folder inside. Now I have the same files and folders on the debian system and run ant, but the dist folder never contains any dependency bans in the lib folder.

Settings in the project, etc. true.

I am using ant 1.8.0 with debian 6.0.3 and ant 1.8.2 with xp windows.

Here is the ant script generated by netbeans http://pastebin.com/dk2x8Na1 .

What's wrong?

+4
source share
2 answers

I found the "error":

I compared the log files and found the problem:

-U-bank-s-library-package:
Skipped because do.mkdist property is not set.

You can find the following in the build.xml file:

<condition property="do.mkdist"> <and> <isset property="do.archive"/> <isset property="libs.CopyLibs.classpath"/> <not> <istrue value="${mkdist.disabled}"/> </not> </and> </condition> 

It seems libs.CopyLibs.classpath is not installed. There is an implementation from NetBeans that you can find here java / ant / extra. The lib is called org-netbeans-modules-java-j2seproject-copylibstask.jar.
I added the following properties to my project:

 libs.CopyLibs.classpath=tools/org-netbeans-modules-java-j2seproject-copylibstask.jar 

After that, everything works fine with Debian.

+3
source

From my experience of developing on a Windows environment and then deploying on Linux, there are a few things that can be a problem:

  • Using paths: always use / Temp / application / alpha rather than C: \ Temp \ application \ alpha - slash / equivalent to double backslash \ on Windows and compatible with Linux
  • Make sure the Java version on Linux is the same, and also 32/64, like your version for Windows.
  • Make sure any third-party banners are included in your version of Java Java, for example. security updates etc.
  • Your global path is set correctly. Especially when doing cron jobs.
  • Use java environment variables whenever possible. For example, when linking to a temporary folder, use $ {java.io.tmpdir}.

I tried to answer your question with very little information.

Can you provide your ant script?

0
source

Source: https://habr.com/ru/post/1397572/


All Articles