Getting started with Java on a Mac

W

Wayne Dernoncourt

I've been looking for a programming language to help me write tools to do
stuff. For example generate 2-D plots from CSV or text files. C++ can do
that (and more) but there's a lot more overhead and maintenance that that
requires. In the past I've used Tcl/Tk for that kind of task but that seems
to be dying<sniff>, Excel with Visual Basic can do most of that but not so
much on the Mac.

I have a book "Core Jave" by Sun but I'm at a loss on how to start Java on my
Mac. Is there any help for this noob?
 
R

Roedy Green

I have a book "Core Jave" by Sun but I'm at a loss on how to start Java on my
Mac. Is there any help for this noob?

You can do quite a bit with cannibalising. For example
see http://mindprod.com/products1.html#CSV to read CSV files.

Look at http://mindprod.com/products1.html#BIO for how you might plot
graphs. All the pieces are there for you to build a program to plot
CSV files.

You want something fancier, see http://mindprod.com/jgloss/graph.html
I think some of the plotting packages are free.
 
J

Jim Gibson

Wayne said:
I've been looking for a programming language to help me write tools to do
stuff. For example generate 2-D plots from CSV or text files. C++ can do
that (and more) but there's a lot more overhead and maintenance that that
requires. In the past I've used Tcl/Tk for that kind of task but that seems
to be dying<sniff>, Excel with Visual Basic can do most of that but not so
much on the Mac.

I have a book "Core Jave" by Sun but I'm at a loss on how to start Java on my
Mac. Is there any help for this noob?

Java will run on a Mac, but is not well supported. Java is (or was)
provided by Apple, but the version often lagged, and they have
announced dropping support for Java. You will then depend upon Oracle
or some other party providing a Mac version:

<http://www.apple.com/pr/library/2010/11/12Oracle-and-Apple-Announce-Ope
nJDK-Project-for-Mac-OS-X.html>

Eclipse is available, so you might want to use that, although there
will be a bit of a learning curve.

I use a combination of Perl and gnuplot to generate 2D plots from CSV
or text files on a Mac. Since you are coming from Tcl/Tk, maybe picking
up Perl wouldn't be too hard.
 
W

Wayne Dernoncourt

Java will run on a Mac, but is not well supported. Java is (or was)
provided by Apple, but the version often lagged, and they have
announced dropping support for Java. You will then depend upon Oracle
or some other party providing a Mac version:

That's what I was afraid of...

But if it will let me learn how to get things started, it might be enough. I
may have to recondition an old WinXP desktop that is lying around and see
what I can get for that.
Eclipse is available, so you might want to use that, although there
will be a bit of a learning curve.

I use a combination of Perl and gnuplot to generate 2D plots from CSV
or text files on a Mac. Since you are coming from Tcl/Tk, maybe picking
up Perl wouldn't be too hard.

It's been 10-12 years since I've used Perl, one of the "potential"
applications is 3D rotation in plotting points from a text file. Currently
one of the guys at work is using Matlab for that, I was hoping for something
a little simpler.
 
J

Jim Gibson

Wayne said:
It's been 10-12 years since I've used Perl, one of the "potential"
applications is 3D rotation in plotting points from a text file. Currently
one of the guys at work is using Matlab for that, I was hoping for something
a little simpler.

gnuplot will plot 3D plots from numbers in a text file, if the file is
formatted appropriately. It can also do rotation of the view point.
However, it is just for display, and you can't (AFAIK) store the
resulting rotated points.

There are several IDEs for Java under Mac OS X:

<http://www.google.com/search?rls=en&q=java+ide+for+mac+os+x&ie=UTF-8&oe
=UTF-8>

One of those might get you started quickly. I haven't used any of them
under Mac OS, so can't recommend any in particular.
 
A

Arved Sandstrom

Java will run on a Mac, but is not well supported.

I'm not advocating Java for the OP's requirements, but I think it's a
bit of a stretch to say that Java on Mac OS X isn't/hasn't been well
supported. I'm running 1.6.0_29 on my MacBook right now, and that came
out for Mac OS X only a few weeks after the update release for other
platforms. It's been my experience for years (and I've used Java on Macs
going back to when Java appeared) that Apple support for Java on Classic
Mac and Mac OS X has been very good.

Granted I am not a Java GUI guy, I may have written half a dozen trivial
AWT or Swing apps ever in over a decade, and most of them not on a Mac
anyway, so there could be some cruftiness when it comes to that side of
things, but overall Mac Java support is very good. IMO.
Java is (or was)
provided by Apple, but the version often lagged, and they have
announced dropping support for Java. You will then depend upon Oracle
or some other party providing a Mac version:

<http://www.apple.com/pr/library/2010/11/12Oracle-and-Apple-Announce-Ope
nJDK-Project-for-Mac-OS-X.html>

No, Apple is not dropping support for Java. Apple is contributing to
OpenJDK, AFAIK.
Eclipse is available, so you might want to use that, although there
will be a bit of a learning curve.

I use a combination of Perl and gnuplot to generate 2D plots from CSV
or text files on a Mac. Since you are coming from Tcl/Tk, maybe picking
up Perl wouldn't be too hard.
Well, I used Perl intensively back in the early and mid-90's, and I
still have a pathological, masochistic fondness for it. I dunno as how
I'd nominate it as a first choice; Ruby support on Mac OS X is quite
good, and that's worth looking at.

AHS
 
J

John B. Matthews

Wayne Dernoncourt said:
I've been looking for a programming language to help me write tools
to do stuff. For example generate 2-D plots from CSV or text files.
C++ can do that (and more) but there's a lot more overhead and
maintenance that that requires. In the past I've used Tcl/Tk for
that kind of task but that seems to be dying<sniff>, Excel with
Visual Basic can do most of that but not so much on the Mac.

You might look at JFreeChart [1], especially the Web Start demo [2] and
these examples [3, 4].

[1] <http://www.jfree.org/jfreechart/>
[2] <http://www.jfree.org/jfreechart/samples.html>
[3] <http://stackoverflow.com/q/5522575/230513>
 
G

Gene

[...] It's been my experience for years (and I've used Java on Macs
going back to when Java appeared) that Apple support for Java on Classic
Mac and Mac OS X has been very good.
Granted I am not a Java GUI guy, I may have written half a dozen trivial
AWT or Swing apps ever in over a decade, and most of them not on a Mac
anyway, so there could be some cruftiness when it comes to that side of
things, but overall Mac Java support is very good. IMO.

My experience with Java and the Mac is not as extensive as yours, going
back only five years.  But I'd say that given that Apple's Java on the Mac
was still stuck at 1.5 when 1.7 was on the verge of release, there's
justification for considering Java on the Mac to be lagging.  Note alsothe
problem that on other platforms you can update to the latest Java easily,
while on the Mac (at least historically) the only way to get the latest
Java release was to buy the latest OS version as well.

Maybe with the OpenJDK stuff, Java on the Mac will become less-proprietary,
more up-to-date, etc.  And I'd certainly agree that Java development onthe
Mac is viable, even if the API lags behind the rest of the world.  But I'd
definitely not call Apple's support of Java on the Mac "very good".  I
wouldn't even call it close to that.

It's something like a red herring to say Apple support for Java is
this or that. Certainly Microsoft provides less support under
Windows. Ditto for Linux. Apple is unique in embracing Java at all.

Moreover, Apple's policy of associating a Java release with each OS X
release is a more sane lifecycle management strategy than the once-
every-two-months routine release of the JVM/JDK. Ask any Windows user
who runs it what they think of the Java update daemon! If developers
don't appreciate the stability that the Apple policy affords, users
certainly do. And guys/gals...users are more important.

In all, the policy of frequent releases seems for more than 15 years
to have fostered a Java culture of half-baked architectures and
okayness with bugs a la amateur night. Ultimately, this is why Java
has never reached the tipping point as a web dynamic content
mechanism. What a shame... Java could have been Flash. And the
world would have been a better place.

Upshot: If Oracle ultimately makes an annual, high quality Java
release for all platforms, life is going to be better for everyone
than the current ad hoc mish mosh.

Just an opinion...
 
A

Arved Sandstrom

[...] It's been my experience for years (and I've used Java on Macs
going back to when Java appeared) that Apple support for Java on Classic
Mac and Mac OS X has been very good.

Granted I am not a Java GUI guy, I may have written half a dozen trivial
AWT or Swing apps ever in over a decade, and most of them not on a Mac
anyway, so there could be some cruftiness when it comes to that side of
things, but overall Mac Java support is very good. IMO.

My experience with Java and the Mac is not as extensive as yours, going
back only five years. But I'd say that given that Apple's Java on the Mac
was still stuck at 1.5 when 1.7 was on the verge of release, there's
justification for considering Java on the Mac to be lagging. Note also the
problem that on other platforms you can update to the latest Java easily,
while on the Mac (at least historically) the only way to get the latest
Java release was to buy the latest OS version as well.

Maybe with the OpenJDK stuff, Java on the Mac will become less-proprietary,
more up-to-date, etc. And I'd certainly agree that Java development on the
Mac is viable, even if the API lags behind the rest of the world. But I'd
definitely not call Apple's support of Java on the Mac "very good". I
wouldn't even call it close to that.

Pete

OK, OK, maybe I was in a really charitable mood when I wrote my first
reply. I'll revise my opinion and say that I think Apple support for
Java has been good, and sometimes very good.

It hasn't been just 1.5->1.6 that exhibited a delay, the other jumps
(1.3->1.4, 1.4->1.5) have been like that too. I believe that there is a
developer base that is relatively unconcerned about this (like me), and
that's server-side folks who see their product ultimately deploy on
Windows or Solaris or Linux against an older JVM from Sun (now Oracle)
or IBM or BEA (now Oracle). Not many "enterprise" clients upgrade their
infrastructure so quick either.

I have to acknowledge that Mac Java developers who want to write
consumer-type GUI software didn't pick the best platform for it.
Although I personally believe that anyone who "needs" the latest Java
the day it comes out has misplaced priorities, it's not my place to say,
I'm not a writer of consumer GUI apps. So if such a person is wedded to
the Mac (for other good reasons) but needs the latest Java, they'd best
use a VM. And quite frankly a lot of professional developers using Macs
do use VMs anyway. I know I do. So it's a moot point actually. Given
that the VMs are so good it's a wonder that Apple didn't throw in the
towel for Java support a long time ago.

Apple does have different priorities, like linking major Java upgrades
to their major OS upgrades. I can see reasons for that, without being an
Apple fanboi.

AHS
 
L

Lew

[...] It's been my experience for years (and I've used Java on Macs
going back to when Java appeared) that Apple support for Java on Classic
Mac and Mac OS X has been very good.
Granted I am not a Java GUI guy, I may have written half a dozen trivial
AWT or Swing apps ever in over a decade, and most of them not on a Mac
anyway, so there could be some cruftiness when it comes to that side of
things, but overall Mac Java support is very good. IMO.

My experience with Java and the Mac is not as extensive as yours, going
back only five years. But I'd say that given that Apple's Java on the Mac
was still stuck at 1.5 when 1.7 was on the verge of release, there's
justification for considering Java on the Mac to be lagging. Note also the
problem that on other platforms you can update to the latest Java easily,
while on the Mac (at least historically) the only way to get the latest
Java release was to buy the latest OS version as well.

Maybe with the OpenJDK stuff, Java on the Mac will become less-proprietary,
more up-to-date, etc. And I'd certainly agree that Java development on the
Mac is viable, even if the API lags behind the rest of the world. But I'd
definitely not call Apple's support of Java on the Mac "very good". I
wouldn't even call it close to that.

It's something like a red herring to say Apple support for Java is
this or that. Certainly Microsoft provides less support under
Windows. Ditto for Linux. Apple is unique in embracing Java at all.

Linux supports Java just fine, at least some distros. OTOH, saying that
"Linux supports <?>" is a bit of an oxymoron.

Regardless, here in Ubuntu you just "sudo apt-get dist-upgrade" and your Java
is updated to the latest stable release for Ubuntu. It's hardly required to
support it any more than that, since that's how Ubuntu supports literally
everything it's meaningful to say it supports.
 
J

John B. Matthews

Arved Sandstrom said:
It hasn't been just 1.5->1.6 that exhibited a delay, the other jumps
(1.3->1.4, 1.4->1.5) have been like that too. I believe that there is
a developer base that is relatively unconcerned about this (like me),
and that's server-side folks who see their product ultimately deploy
on Windows or Solaris or Linux against an older JVM from Sun (now
Oracle) or IBM or BEA (now Oracle). Not many "enterprise" clients
upgrade their infrastructure so quick either.

Apple sometimes makes pre-release versions available to developers
under the terms of a license that limits disclosures.
I have to acknowledge that Mac Java developers who want to write
consumer-type GUI software didn't pick the best platform for it.

Supporting cross-platform Swing applications has improved my
understanding of layouts and the UI delegate's role in calculating
preferred size, among other things.
Although I personally believe that anyone who "needs" the latest Java
the day it comes out has misplaced priorities, it's not my place to
say, I'm not a writer of consumer GUI apps. So if such a person is
wedded to the Mac (for other good reasons) but needs the latest Java,
they'd best use a VM. And quite frankly a lot of professional
developers using Macs do use VMs anyway. I know I do. So it's a moot
point actually. Given that the VMs are so good it's a wonder that
Apple didn't throw in the towel for Java support a long time ago.

Oracle's VirtualBox is a good example.

[...]
 
A

Arne Vajhøj

Java will run on a Mac, but is not well supported. Java is (or was)
provided by Apple, but the version often lagged, and they have
announced dropping support for Java. You will then depend upon Oracle
or some other party providing a Mac version:

<http://www.apple.com/pr/library/2010/11/12Oracle-and-Apple-Announce-Ope
nJDK-Project-for-Mac-OS-X.html>

In the end Apple turned over the relevant code to OpenJDK,
so OpenJDK is Java for MacOS X from 1.7+.

It is still preview not GA, but you can get it here:

http://jdk7.java.net/macportpreview/

Arne
 
A

Arne Vajhøj

They did, but then they announced that they will support Java going
forward.

They donated code to OpenJDK - OpenJDK will support
moving forward.

Download link posted in another post.

Arne
 
A

Arne Vajhøj

[...] It's been my experience for years (and I've used Java on Macs
going back to when Java appeared) that Apple support for Java on Classic
Mac and Mac OS X has been very good.
Granted I am not a Java GUI guy, I may have written half a dozen trivial
AWT or Swing apps ever in over a decade, and most of them not on a Mac
anyway, so there could be some cruftiness when it comes to that side of
things, but overall Mac Java support is very good. IMO.

My experience with Java and the Mac is not as extensive as yours, going
back only five years. But I'd say that given that Apple's Java on the Mac
was still stuck at 1.5 when 1.7 was on the verge of release, there's
justification for considering Java on the Mac to be lagging. Note also the
problem that on other platforms you can update to the latest Java easily,
while on the Mac (at least historically) the only way to get the latest
Java release was to buy the latest OS version as well.

Maybe with the OpenJDK stuff, Java on the Mac will become less-proprietary,
more up-to-date, etc. And I'd certainly agree that Java development on the
Mac is viable, even if the API lags behind the rest of the world. But I'd
definitely not call Apple's support of Java on the Mac "very good". I
wouldn't even call it close to that.

It's something like a red herring to say Apple support for Java is
this or that. Certainly Microsoft provides less support under
Windows. Ditto for Linux. Apple is unique in embracing Java at all.

No.

IBM support Java on z/OS.
IBM support Java on i.
IBM support Java on AIX.
HP support Java on HP-UX.
HP support Java on OpenVMS.
SUN/Oracle support Java on Solaris.

This is the Java model. The OS vendor support Java
for their platform.

It was even supposed to be the case for Windows, but SUN
and MS ended up in court and MS stopped developing Java/non-Java.

Moreover, Apple's policy of associating a Java release with each OS X
release is a more sane lifecycle management strategy than the once-
every-two-months routine release of the JVM/JDK. Ask any Windows user
who runs it what they think of the Java update daemon!

They probably like that Java behaves similar to Windows itself,
AcrobatReader, Flash, FireFox, ThunderBird etc..

Automatic updating is standard today.

In all, the policy of frequent releases seems for more than 15 years
to have fostered a Java culture of half-baked architectures and
okayness with bugs a la amateur night. Ultimately, this is why Java
has never reached the tipping point as a web dynamic content
mechanism. What a shame... Java could have been Flash. And the
world would have been a better place.

Upshot: If Oracle ultimately makes an annual, high quality Java
release for all platforms, life is going to be better for everyone
than the current ad hoc mish mosh.

Just an opinion...

Given that it is typical security fixes that drive the release
of Java updates, then updating once a year would be a complete
disaster.

Arne
 
W

Wayne Dernoncourt

gnuplot will plot 3D plots from numbers in a text file, if the file is
formatted appropriately. It can also do rotation of the view point.
However, it is just for display, and you can't (AFAIK) store the
resulting rotated points.

The results are just for displaying the points. I have no clue if/when I'm
going to deal with surfaces (the Z-axis), the points are physically on
surfaces and the target users need to be able to identify points on the
physical surfaces. I know that this could very well neer happen. There is a
guy that had a way to use Maya(?) to produce views with a surface model and
overlaying the points. He insisted that he needed more information (a more
refined surface model, etc.) - using ping pong balls instead of the actual
shapes would've been fine, that is it's better than what we have. It never
happened, sigh.

<WRT matrix math, etc.) MATLAB is terrific for lots of things, for other
things it's overkill.
There are several IDEs for Java under Mac OS X:

One of those might get you started quickly. I haven't used any of them
under Mac OS, so can't recommend any in particular.

I haven't had the time/inclination to do that over the weekend. I'll d that
shortly. Thanks much.
 
W

Wayne Dernoncourt

I've written code in Tcl/Tk to "tie" programs together mainly in the Unix
world. It was very useful but the last time I tried to get Tcl/Tk to work it
didn't work well (it wouldn't run, I don't remember the issue but there were
other alternatives at the time).
gnuplot will plot 3D plots from numbers in a text file, if the file is
formatted appropriately. It can also do rotation of the view point.
However, it is just for display, and you can't (AFAIK) store the
resulting rotated points.
There are several IDEs for Java under Mac OS X:

One of those might get you started quickly. I haven't used any of them
under Mac OS, so can't recommend any in particular.

It looks like Eclipse might fill the bill, I need to do some reading to
figure out which version is appropriate - EE, Classic, etc.
 
A

Arne Vajhøj

It looks like Eclipse might fill the bill,

I strongly suspect that NetBeans would work too.
I need to do some reading to
figure out which version is appropriate - EE, Classic, etc.

desktop apps => Eclipse IDE for Java Developers

server apps => Eclipse IDE for Java EE Developers

Arne
 
W

Wayne Dernoncourt

I strongly suspect that NetBeans would work too.

I was thinking NetBeans was targeted towards enterprise apps, obviously I
need to widen reading.
desktop apps => Eclipse IDE for Java Developers
server apps => Eclipse IDE for Java EE Developers

Thank you for the clarifying that. I'm starting out as a beginner so I'm
going for desktop apps for now.
 
A

Arne Vajhøj

//www.google.com/search?rls=en&q=java+ide+for+mac+os+x&ie=UTF-8&oe[/URL]
=UTF-8>

One of those might get you started quickly. I haven't used any of them
under Mac OS, so can't recommend any in particular.

It looks like Eclipse might fill the bill,

I strongly suspect that NetBeans would work too.

I was thinking NetBeans was targeted towards enterprise apps, obviously I
need to widen reading.

NetBeans should cover both SE and EE apps.

Arne
 
A

Arne Vajhøj

I don't want to start another IDE war, but I will point out that I
switched from Netbeans to Eclipse years ago and haven't looked back.

I prefer Eclipse too.

But there are also those that prefer NetBeans.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top