Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

ANT Build Tool on Apple Silicon Mac

 
Ranch Hand
Posts: 301
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anyone tried using ANT on a new Apple Silicon M1 based mac ?

I cannot seem to find any arm builds at all and was wondering if I'm either not looking in the right place or if the Rosetta 2 emulation works ok.

Dave
 
Saloon Keeper
Posts: 7236
169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ant is written completely in Java, so the kind of silicon you have is not relevant. As long as you have Java running, Ant can run.
 
David Garratt
Ranch Hand
Posts: 301
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I unzip the ant binary download on my mac I see a file called ant which is described as a linux binary and I assume that providing this folder is on my path that this is what is running when I type "ant" at the terminal prompt ?

These are the files I see in the ant folder

-rwxr-xr-x@ 1 dave  staff  11730 10 Jul 19:36 ant
-rw-r--r--@ 1 dave  staff   7471 10 Jul 19:36 ant.bat
-rw-r--r--@ 1 dave  staff   2856 10 Jul 19:36 ant.cmd
-rwxr-xr-x@ 1 dave  staff    862 10 Jul 19:36 antRun
-rw-r--r--@ 1 dave  staff   1533 10 Jul 19:36 antRun.bat
-rwxr-xr-x@ 1 dave  staff   2118 10 Jul 19:36 antRun.pl
-rw-r--r--@ 1 dave  staff   3410 10 Jul 19:36 antenv.cmd
-rwxr-xr-x@ 1 dave  staff   3459 10 Jul 19:36 complete-ant-cmd.pl
-rw-r--r--@ 1 dave  staff   4316 10 Jul 19:36 envset.cmd
-rw-r--r--@ 1 dave  staff   1113 10 Jul 19:36 lcp.bat
-rwxr-xr-x@ 1 dave  staff   4167 10 Jul 19:36 runant.pl
-rwxr-xr-x@ 1 dave  staff   3344 10 Jul 19:36 runant.py
-rw-r--r--@ 1 dave  staff   1815 10 Jul 19:36 runrc.cmd
 
Saloon Keeper
Posts: 24886
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And, incidentally, this also applies to Maven and probably Gradle (I haven't checked that one, though).

The essential parts of Tomcat are likewise "write-once/run-anywhere".
 
David Garratt
Ranch Hand
Posts: 301
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:And, incidentally, this also applies to Maven and probably Gradle (I haven't checked that one, though).

The essential parts of Tomcat are likewise "write-once/run-anywhere".



Sorry - do you means it's all java or are you referring to the presence of what I assume is a intel binary ?
 
Tim Holloway
Saloon Keeper
Posts: 24886
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ant and Maven are 100% Java.

There are additions to Tomcat that are not, but they are performance-enhancers and, for Windows, stuff that makes it possible to run Tomcat as a Windows Service.

Tomcat can run perfectly well without the performance enhancers, and in fact I never use them, because to me, needing an extra boost in Tomcat means that I'm probably overloading Tomcat and need to refactor before even performance enhancers don't help.

As for Windows service support, you can run Tomcat just fine under Windows. It's just a way to allow auto-start and control panel management.
 
Tim Moores
Saloon Keeper
Posts: 7236
169
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I see a file called ant which is described as a linux binary and I assume that providing this folder is on my path that this is what is running when I type "ant" at the terminal prompt ?


Those are all shell scripts of various kinds, not native executables. Some are not applicable to MacOS, such as *.bat which are for Windows. "ant" is indeed the correct one. You can verify in any editor that it is a shell script.

Tomcat doesn't have anything to do with Ant, so don't get confused by that.
 
David Garratt
Ranch Hand
Posts: 301
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok - I understand now.

Thank you

Dave
 
Tim Holloway
Saloon Keeper
Posts: 24886
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:Tomcat doesn't have anything to do with Ant, so don't get confused by that.



Though like Ant, Tomcat does have both Unix/Linux shell scripts and Windows BAT files in its "bin" directory. So does Maven (CMD files, actually).

It's slightly obscured because in Unix-like systems, the file extension doesn't determine whether a file is executable (as a binary or as a shell script), instead the "executable" attribute in its directory entry determines that at owner, group, and world levels. So a an "xxx.sh" might not be executable, while a "foo" might be a shell script or binary executable.
 
David Garratt
Ranch Hand
Posts: 301
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I will soon need counselling before I figure out how to get everything working on an Apple Silicon Mac.

You would think it would be simple - all I want is a version of Eclipse with runs natively on the mac (arm based) and can run both WindowBuilder and JasperStudio plugins - ahhh no chance.

Eclipse for arm is based on Java 17 - but Jasper plugin fails and needs Java 16.  No idea about windowbuilder yet but I suspect I will be using rosetta 2 and emulation for some time.

There does not seem to be an arm build of Eclipse for Java 16.

hoo hum, thanks for everyone's help.

Dave
 
Tim Holloway
Saloon Keeper
Posts: 24886
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you're trying to live a little too close to the cutting edge there.
 
Marshal
Posts: 8209
585
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Garratt wrote:When I unzip the ant binary download on my mac I see a file called ant which is described as a linux binary and I assume that providing this folder is on my path that this is what is running when I type "ant" at the terminal prompt ?

These are the files I see in the ant folder

-rwxr-xr-x@ 1 dave  staff  11730 10 Jul 19:36 ant
-rw-r--r--@ 1 dave  staff   7471 10 Jul 19:36 ant.bat
-rw-r--r--@ 1 dave  staff   2856 10 Jul 19:36 ant.cmd
-rwxr-xr-x@ 1 dave  staff    862 10 Jul 19:36 antRun
-rw-r--r--@ 1 dave  staff   1533 10 Jul 19:36 antRun.bat
-rwxr-xr-x@ 1 dave  staff   2118 10 Jul 19:36 antRun.pl
-rw-r--r--@ 1 dave  staff   3410 10 Jul 19:36 antenv.cmd
-rwxr-xr-x@ 1 dave  staff   3459 10 Jul 19:36 complete-ant-cmd.pl
-rw-r--r--@ 1 dave  staff   4316 10 Jul 19:36 envset.cmd
-rw-r--r--@ 1 dave  staff   1113 10 Jul 19:36 lcp.bat
-rwxr-xr-x@ 1 dave  staff   4167 10 Jul 19:36 runant.pl
-rwxr-xr-x@ 1 dave  staff   3344 10 Jul 19:36 runant.py
-rw-r--r--@ 1 dave  staff   1815 10 Jul 19:36 runrc.cmd


Are you sure you downloaded mac relevant files? These look to me like Windows stuff.

If you find it too trouble, try to use package manager of some sort. Like brew or MacPorts, potentially you'd find it easier to install things you need.
 
Tim Moores
Saloon Keeper
Posts: 7236
169
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Are you sure you downloaded mac relevant files? These look to me like Windows stuff.


That's the standard Ant distribution, which -as I mentioned earlier- includes the scripts for Unix-like OSes like macOS.
 
David Garratt
Ranch Hand
Posts: 301
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's all clear for me now. I had assumed the file at the top was a binary program when in fact is it a script and will then of course run on a M1 Mac.

Thanks anyway

Dave
 
Liutauras Vilda
Marshal
Posts: 8209
585
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And I went and bought yesterday M1 mac, more precisely, replaced my 7 years old intel-based mac.

So yes, like yourself, didn't have any issues with Ant. But I installed through homebrew. Had a struggle to upgrade to Monterey though, but finally managed via Recovery mode.

Anyway, it seems M1 opened a new realm in macOS world. In particular, a lot of applications will need to provide the support for mac arm architecture. I.e. even to get jdk, for instance 8 isn't a simple task, only Zulu ported it it seems, while Java 17 everyone, so could be some issues with old software.
 
Tim Holloway
Saloon Keeper
Posts: 24886
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. So far we've gone from:

Motorola MC68000
PowerPC
Intel
ARM

This is getting old. Maybe they should just consider re-doing the whole thing as a virtual bytecode architecture. Or get Linus Torvalds back at work on the customizable-processor thing.

Since Java is "supposed" to be write-once/run-anywhere, I think I'd seriously consider setting up a Linux box to do the development on and ship the WAR/JAR/whatever files over when done. Might have better luck.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic