Gday, I've been reading these forums for months now (often as a guest) but this is my first post.
I have finally got my act together and downloaded JMonkey last night.
I have been planning some development for some time.
My experience with Java is fairly good and I have developed applications in Java for purely Windows XP environments before (mostly using Swing though… yuk. :P).
I am completely new to coding on a mac (not new to macs). I have installed Netbeans, Eclipse and XCode (as I read lots of conflicting things on all 3 so I thought I'd give them all a go).
I used NetBeans CVS to get JMonkey (Success!!). But I'm not sure how to compile and set it all up.
Normally I code in a text editor on Windows/Linux and do my work in the text editor or on the command line (CMD.exe).
I don't want to go ahead doing things and completely screw it up.
So is there a Mac walk-through or Tutorial for Jmonkey anywhere?
Or failing that anyone who codes JMonkey on a mac who can help me?
Thanks in advance!
I am a Mac User too, and I use Eclipse. I never had any problem with project setup compile or anything else.
For NetBeans or Eclipse setup you can follow the tutorials at this page: http://www.jmonkeyengine.com/wiki/doku.php?id=the_tutorials, “NetBeans Guide to jME & jME Physics 2” and “Eclipse Guide to jME”. About Xcode I don’t know, but I suggest you to not use it for Java crossplatform projects like jME, even if it has a really useful and wide documentation included. Maybe you can open it to just browse the documentation.
Netbeans looks a like nicer setup to me personally (bit bloated though )and it has that lovely tutorial. So I'll go with that.
I heard XCode can have cross-platform JAVA related issues.
I'm keen to avoid them so I wont bother with it.
Is there any way to set a text editor or Netbeans as the default for opening .java files at all?
Its a pain to wait for XCode to open when Netbeans is already open as well.
Yes. Select a .java-file in the Finder, press Cmd-I, go to the "Open With"-section, select your program of choice using the popup-button and press the "Change All…"-button right underneath it.
Thanks for that.
EDIT: Neither NetBeans nor Eclipse can open it .java files properly. I can open it manually with both of them by going File > Open but thats it. TextEdit it is.
EDIT #2:
Ok everything went very smoothly until I was creating the Javadoc files and I got an error, but it said it was successful.
I was in NetBeans Library Manager and it was all going well until I tried to add the Javadocs, then I get the error:
Invalid Javadoc root /Users/Lux/JMonkey/jme/data/doc
The Javadoc root does not contain the index-files folder or the index-all.html file.
I am guessing the building of the Javadocs was not successful. lol.
I'll upload the build report shortly (when my ftp is working again… >.>)
Gaiyamato said:
EDIT: Neither NetBeans nor Eclipse can open it .java files properly. I can open it manually with both of them by going File > Open but thats it. TextEdit it is. :D
Well, yes, Java-developers tend to think that just because the application does run on the target operating system, they don't have to care about platform-specific issues. That's probably the main problem why nobody likes Java user interfaces on the Mac.
Well I like my mac, but I am noticing a large learning curve full of "platform specific" oddities cropping up.
I'm tempted to just use X11 and work in a 'linux' environment. lol.
Here is the log of my javadoc build which apparently worked but didn't:
http://www.online-behemoth.com/JME_Java_Doc_Build.rtf
BTW: I tried setting up JME on XP yesterday and it went without a hitch. Its the only thing in my computing life that has gone without a hitch on XP and not on the mac… >.>
i'd recommend using eclipse to rebuild the jme project from the cvs source…
it's far far less painful and takes about 30 seconds to set up…
are you attempting to generate the javadocs using the ant build command???
i just searched the xcode and java dev mailing lists and i could find no cross platform issues with xcode as xcode just calls java compiler and the jar tool, it does nothing to the finished product itself (unless you are talking about using the cocoa ui with xcode applications which is mac specific)…
ncomp said:
(unless you are talking about using the cocoa ui with xcode applications which is mac specific)...
Creating Cocoa interfaces in Java is deprecated. According to Apple, you should write an Objective C view layer and use JNI to talk to the Java code instead.
If Xcode gives not problem use Xcode. It is a great IDE. I just fell more comfortable to use Eclipse than use Xcode when I code Java. Maybe because I still do not know Xcode very well and it needs to be configured (for example if you want a Eclipse like code completion). Moreover, Eclipse offers some really good plugins for SWING GUI visual editing, while Xcode partner application, Interface Builder, is oriented more to build Cocoa interfaces. At least I do not know how to use it to build SWING GUIs…
About the problems compiling Javadoc, I use Eclipse on Mac OS X Tiger and I have no problem. Maybe NetBeans is not the best application for Mac, or maybe it does not identify and configure automatically some system specific settings. Just to test it try downloading Ant and use it out of any IDE environment.
Moreover Mac OS is not full of any platform specific oddities. At least not more than other systems. Mac OS is a system, in part different from others system. Exactly like Linux is different from Windows and Windows is different from Mac OS or Linux. There are applications that under Linux run like a breeze and applications that do not. The same happens in Windows or Mac OS. Most of the times this happens because who developed those applications did it with a specific platform in mind.
Ender said:
If Xcode gives not problem use Xcode. It is a great IDE. I just fell more comfortable to use Eclipse than use Xcode when I code Java. Maybe because I still do not know Xcode very well and it needs to be configured (for example if you want a Eclipse like code completion).
Well, I know Xcode very well (being a part-time Cocoa developer), but I'm still using Eclipse for Java development. Xcode was built by Objective C programmers for Objective C programmers, and it shows everywhere. Eclipse is much better for Java.
Interface Builder, is oriented more to build Cocoa interfaces. At least I do not know how to use it to build SWING GUIs...
Quite simply, you can't.
The same happens in Windows or Mac OS. Most of the times this happens because who developed those applications did it with a specific platform in mind.
I've yet to see a single non-Cocoa/Carbon application use the proper widget for the toolbar. For example, Eclipse's own toolbar looks like a straight copy of Microsoft Word's.
Just my 2 cents…
Neither NetBeans nor Eclipse can open it .java files properly. I can open it manually with both of them by going File > Open but thats it. TextEdit it is.
I know quite a few people who develop on Macs, and they use Eclipse with a few plugins (they do Python development as well as Java). In regards to opening files with Eclipse: Eclipse is more powerful when dealing with projects (see Package Explorer view) that consist of many files, rather than opening a single file. You can just create a new project and import the existing Java files into it. Using a simple text editor for projects and compiling by hand is most likely going to be a PITA.
Opening Java files with Eclipse would deal with setting the OS file associations. I'm not familiar with doing this on Mac, but it's very easy with Linux.
I tried Netbeans for a short period of time, but had too many issues dealing with importing my existing projects, so I gave up.
sarcius said:
Opening Java files with Eclipse would deal with setting the OS file associations. I'm not familiar with doing this on Mac, but it's very easy with Linux.
It seems it is not possible to double-click a *.java file and having Eglipse opening it automatically. The way to set it up would be to do LMB -> Open With -> Others... (this is my translation of menu from Italian ;) ) but Eclipse application icon is not active when I go to its folder. This means Eclipse is not well prepared for Mac OS X and it does not recognise the application as a application capable to open *.java files, even if the file with the Eclipse icon seems to be a regular application bundle. jEdit application bundle, for example, is recognized by Mac OS X to be able to read *.java files and appear as active if you do the above sequence with the context menu.
Normal Java jars or classes are not recognized by Mac OS X for this feature (double-click and opening the file with the correct application). I tryed to make a bundle of ArgoUML using the Jar Bundler included in the developers applications to see if I am able to tell Mac OS X to open automatically *.uml files with it, but it does not work, even if apparently it is structured the same way as jEdit bundle.
Investigating deeper I discovered that in the jEdit bundle package the "info.plist" file is a little different. jEdit "info.plist" file has a variable that my ArgoUML self made bundle and Eclipse bundle do not have. It is an array called NSServices, and contains 3 elements containing NSMenuItem, NSMessage, NSPortName and NSSendTypes. I don't know if they are some way related to the ability to open a file with a doble-click on the file icon in the system, but i guess it could be related.
anlumo said:The same happens in Windows or Mac OS. Most of the times this happens because who developed those applications did it with a specific platform in mind.
I've yet to see a single non-Cocoa/Carbon application use the proper widget for the toolbar. For example, Eclipse's own toolbar looks like a straight copy of Microsoft Word's.
Eh, eh, eh! :D
Widgets are a bad argument in non Mac systems. They have a big number of options, more than native, that can make a lot of confusion. GTK+ and QT are 2 examples. Also Mac OS X has native ports of QT and other widgets oriented frameworks (only GTK+ have still not been ported succesfully) but I see that wise Mac developers use native Cocoa/Aqua.
sarcius said:
Opening Java files with Eclipse would deal with setting the OS file associations. I'm not familiar with doing this on Mac, but it's very easy with Linux.
No. In Mac OS X, you can force applications to open any file no matter its type, but by doing this I discovered that Eclipse simply ignores the open file event.
Ender said:
Eh, eh, eh! :D
Widgets are a bad argument in non Mac systems.
I was talking about running applications on a Mac. Of course you won't have the Mac OS X toolbar on Windows or in X11.
Also Mac OS X has native ports of QT and other widgets oriented frameworks
Those are not really native ports, that's like making a screenshot of Mac OS X, putting it on a Linux desktop background and claiming that you have ported Aqua to Linux.
anlumo said:Also Mac OS X has native ports of QT and other widgets oriented frameworks
Those are not really native ports, that's like making a screenshot of Mac OS X, putting it on a Linux desktop background and claiming that you have ported Aqua to Linux.
Oh! Really? So QT (official from Trolltech) that I have installed on my Mac OS X is not native? What is it then? Is it a hack?
I'm trying to get NetBeans working with jME and am running into the exact same thing as Gaiyamato. Could someone who uses NetBeans give it a look? I would be [maybe a bit less than] eternally grateful [but my day would totally be made]. As I understand it, NetBeans has pretty good JRuby support, and since I already do JRuby scripting in my day job, I would love to use that in my jME project.
Tons of thanks.
PS: Thinking about it twice, I had had similar SymbolNotFound errors when trying to load and extend the SimpleGame class from within jirb (the JRuby interactive mode). So the problem might be a bit bigger than just NetBeans. It's strange because the named classes seem to be in the classpath.
T618, do you think is it possible to test your code without NetBeans? I mean this experiment could make you understand if the cause is Apple Java VM (or System env) or if the cause is NetBeans. For JRuby you should first submit this problem to JRuby community. I think they could point out better than jME community what could be the problem. Though, consider that if I run jME applications under Tiger with Eclipse, that could mean that the problem is to be searched in NetBeans setup.
About the first Gaiyamato's problem seting up Javadoc directory inside NetBeans, I suggest trying to compile jME javadoc using separate Ant installation (there should exist an Ant preinstalled in Mac OS X, but, if not, you can download it from Apache site and configure it using the really simple tutorial available). Then try to setup again the Javadoc directory in NetBeans, after you refreshed the project.
Moreover, I read the output posted by Gaiyamato, and to be honest I do not understand why the compiler should load libraries to compile jME Javadoc. But this can be just my ignorance.
Going to the JRuby community isn't a bad idea, but considering that these are SymbolNotFound errors it seems like there is something more general than the tool used. If you look at the text provided by Galyamato the first error is
/Users/Lux/JMonkey/jme/src/com/jme/math/Matrix4f.java:40: package org.junit does not exist
and then a lot more just like it. I know that any tool must be capable of recognizing packages when they are properly included. The thing is that I'm far from being a software developer (in fact this is my first forray into IDEs - jEdit has always been enough) and I don't know where to start. If I could extract the actual commands being executed by Ant that would be a start, to see if all the correct paths are there. Any tips on how to do that?
I'm also very interested if there is anybody using NetBeans successfully with jME.
I will see if I can run the ant script without NetBeans, though I'm new to Ant as well. The javadoc action has the compile action as a dependency, which is why it compiles first and tries to load libraries.
T618 said:
The thing is that I'm far from being a software developer [...] and I don't know where to start. If I could extract the actual commands being executed by Ant that would be a start, to see if all the correct paths are there. Any tips on how to do that?
[...]
I will see if I can run the ant script without NetBeans, though I'm new to Ant as well. The javadoc action has the compile action as a dependency, which is why it compiles first and tries to load libraries.
I verified that Ant is preinstalled in Mac OS X 10.4.x. Then simply enter the directory where you checked out jME CVS using the Terminal. There should be the build.xml, a file used by Ant to know what to do. Then simply type ant doc in Terminal and press Enter.
This command should compile documentation using only the Ant installed in your system and not the Ant included in NetBeans. This way you should be able compile the documentation without errors (just some warnings). If this attempt fails, there is, probably, something wrong in your system installation.