Welcome! Log In Create A New Profile

Advanced

RepStrapper newbie Java troubles

Posted by Anonymous User 
Anonymous User
RepStrapper newbie Java troubles
February 26, 2007 02:53PM
Hello everybody!

I have now decided to try my self out as RepStrap constuctor . .
The process of collecting parts and planning the design is well on its way.

To be honest I do not think I can contibute to much to the project other than fool-proofing your guides and descriptions. I am familiar with circut design and have the equipment to make my own pcbs at home. I also am able to program my own Microchips but only familiar with the AVR familiy from Atmel.

As recomended on this page I'm going to get the software up and running first and take it step by step from there.
But allready here I meet my first, but probably not last, bump in the road. I'm familiar with java but not on a very advanced level, I know my way around TexPad. Never used Eclipse before. . .
I'm going to post my problems here an hopefully some of you recognize them and can give med some hints.

What i have done so far:
Installed JDK 1.6.0
Java3D 1.5.0
Eclipse
Checkout the RepRap software from:
[reprap.svn.sourceforge.net]

For some reason this did not work the first time, when I tried again I got a lot more in the Package explorer in Eclipse and I was able to at least try and run the application.
The error message i get now is:

ava 3D [dev] 1.4.0-build5-experimental 24 Jun 2005 10:18:22 PDT

Exception in thread "RepRap" java.lang.UnsatisfiedLinkError: javax.media.j3d.MasterControl.getAWT()J
at javax.media.j3d.MasterControl.getAWT(Native Method)
at javax.media.j3d.MasterControl.(Unknown Source)
at javax.media.j3d.VirtualUniverse.(Unknown Source)
at org.reprap.gui.Panel3D.createVirtualUniverse(Panel3D.java:321)
at org.reprap.gui.Panel3D.initJava3d(Panel3D.java:262)
at org.reprap.gui.Panel3D.initialise(Panel3D.java:153)
at org.reprap.gui.RepRapBuild.(RepRapBuild.java:125)
at org.reprap.Main.createAndShowGUI(Main.java:313)
at org.reprap.Main.access$24(Main.java:77)
at org.reprap.Main$23.run(Main.java:574)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

If i understand this error-message right it is unable to locate the MasterControl.class in the j3dcore.jar. The file j3dcore.jar is in my classpath.
Any idea what this can be?
sai
Re: RepStrapper newbie Java troubles
February 26, 2007 10:38PM
If everything is system installed and working, perhaps try deleting the java3d jar files from host/lib.
Anonymous User
Re: RepStrapper newbie Java troubles
February 27, 2007 03:22PM
just tried deleting the files and changing the JARs in the build path to correspond with the new JARs locatins. This gave the same results.
In the errormessage i can push the "Native Method" in
at javax.media.j3d.MasterControl.getAWT(Native Method)

This sends me innto a "Class File Editor" and this one states:
"The source attachment does not contain the source for the file MasterControl.class
You can change the source attachment by clicking Change . . .. below."

I did this and attached the file j3dcore.jar which i know contain the file MasterControl.class.
This changed nothing.
I have attached a screenshot of Eclipse in the Class File Editor.

I appreciate any suggestions at all, i really want this to work.
Any ideas?

Chris
Attachments:
open | download - Screenshot1.JPG (223.1 KB)
sai
Re: RepStrapper newbie Java troubles
February 27, 2007 04:07PM
Could you try running it with jre 1.4 and/or 1.5?
Re: RepStrapper newbie Java troubles
February 27, 2007 05:08PM
I think I got around this by installing the 1.5 Java3D. 1.5.1 is now on stable pre-release:

[java3d.dev.java.net]

Vik :v)
Anonymous User
Re: RepStrapper newbie Java troubles
March 01, 2007 04:22PM
Finally got it to work!
thank you all for your time and help!

Chris
Re: RepStrapper newbie Java troubles
March 03, 2007 01:45AM
I'm so pleased! smileys with beer

I presume that we can now take the "Java 3D not for Macs" stuff off the Wiki site?

Would you like to write something up here for me to put it into the Wiki for you?

Vik :v)
Re: RepStrapper newbie Java troubles
May 16, 2007 11:21PM
For anyone else having the same issues... You need to add the external (ones you installed) libs for java3d in eclispe under Project >> Properties >> Java Build Path >> Libraries. And remove the entries for these libs in found in the Reprap/lib.
Anonymous User
Re: RepStrapper newbie Java troubles
June 01, 2007 09:51PM
I just found an "interesting" bug with dual monitors and I think I know what the resolution is. If you have two monitors they will appear in the monitor control panel as 1 and 2. If you set 2 as your primary monitor the app will crash with Java crash on open - "adding a container to a container on a different Graphics Device" because the window is trying to appear on the primary monitor (2) but the default graphics context always appears to come from monitor 1. If you set monitor 1 as your primary monitor, it works. It looks like this might be a know bug with Java3D so if someone reports it, we know how to stop it happening (as opposed to fixing it).

I am not a java expert so if somebody else knows the fix for this, let me know and I'll try it locally. Its probably a rare occurence because most people will have monitor 1 as the primary monitor (I didn't but do now).

Somebody should start a known bug list! grinning smiley
Severity and Description Path Resource Location Creation Time Id
Project Reprap is missing required library: '\RepRap\lib\comm.jar'
Reprap Build path 1181759211437 56
I can't build the Java "Host" because I keep getting these errors (5). I found the files and put them in the workspace\RepRap\lib file, but it didn't help. I am using windows XP and I am open for suggestions?
Thanks
Re: RepStrapper newbie Java troubles
June 14, 2007 02:55AM
You should be aware that Reprap Java host software development is... probably somewhat less well tested than host software development under Linux. It should be doable, though.

If you just want to *run* the Reprap host software, please just download the reprap-host-0.8.zip file from SourceForge and use that instead of the full development environment. It will save you a lot of hassle.

If you still want to use Eclipse and develop the host software, read on:

Basically, even for development, you don't need those .jar files in Reprap/lib any more, so you can remove them from your project build path and all should be well.

You can either edit your Reprap/.classpath file by hand to remove references to all the .jar files that were previously in lib, or just update using Subversion to grab the current .classpath (I *just* now checked it in!). Or, you can do this in Eclipse, Right click on the host project, then click Build Path and then Configure Build Path. The click the Libraries tab and remove all .jar files from there. They should already be in your jre/lib/ext folder where java will find them, so there is no need to point to a second copy in Reprap/lib now.

Other hints: it might help to check that there is exactly one JRE in that Libraries tab, and that it is the one you want to build with (probably Sun Java 1.5.0, unless you know exactly what you are doing), *and* that it is the JRE from the exact same JDK that you are running Eclipse with. This (multiple JREs/JDKs causing confusion) is (I think) more of a Unix/Linux issue than a Windows one, but... check it just in case.

Hoping this helps, and sorry for leaving Subversion in a somewhat broken state for Eclipse users for a few days -- my fault completely.

I just tested that I can (on a Linux system -- I may even try Windows in a moment!), run Eclipse, specify a new workspace, use the SVN Repository Browsing mode to checkout the host code, switch to Java mode, it builds fine (100 or so warnings, but it builds), it runs, I get the expected Reprap host GUI on screen. I just did that a couple of minutes ago, so I am confident that the subversion repository is currently sufficiently runnable to at least get that far.

I'll try Windows in a moment, and post a followup here on how far I get. My (old, free giveaway because it didn't work for its previous owner!) Windows laptop doesn't have a JDK, never mind nor the Java3D/j3d.org/rxtx libs, on it right now.

Jonathan
Re: RepStrapper newbie Java troubles
June 14, 2007 05:37AM
Two hours plus just to get things to the point that I can compile and run the Reprap host software under Windows!? Wow.

Well, it works. Here's a (hopefully quick, it's 2:20am) writeup of a Windows Reprap Host software *developer* install:

I downloaded a JDK (jdk-1_5_0_11-windows-i586-p.exe) from Sun. (This is not the current one, but using it ensures you can easily build .class files that Macs will understand).

I downloaded Java3D (java3d-1_5_0-windows-i586.exe) from Sun. From [download.java.net] to be specific -- that one you can actually download directly, once you know the URL).

I downloaded the rxtx libs from the normal place [ftp.qbang.org] -- this is the same file for all 3 hosyt platforms.

I downloaded Eclipse from [www.eclipse.org] (and click download and choose a mirror etc.). That's a 122MB download, so be prepared for a slight delay here.

I installed the JDK, letting it install in the default place and install everything. I installed Java3D similarly.

NOTE: You cannot correctly unzip the Eclipse .zip file with Windows built-in "compressed files" shell zip file handler. Use 7-zip from [7-zip.org] instead.

I unzipped Eclipse into C:\Program Files\eclipse .

I grabbed Subclipse by installing that by following these [subclipse.tigris.org] instructions, being sure to only check Subclipse and not Mylar.

I ran Eclipse again and checked out the Reprap Host code as normal from [reprap.svn.sourceforge.net] within Eclipse.

It doesn't build. All sorts of errors. As expected.

I set the default compiler to be "5.0" not 1.4, which helps a bit.

I used 7-zip to open the rxtx .zip file and copied the RXTXcomm.jar to C:\Program Files\Java\jre1.5.0_11\lib\ext AND also to C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext

I used 7-zip some more to copy both .dll files for 32bit Windows in that same rxtx .zip file into the same places BUT using i386 not ext for the last part of the path.

I copied all .jar files in C:\Program Files\Java\Java3D\1.5.0\lib\ext to the same two places I put RXTXcomm.jar. I copied all *.dll files (3 of them) from C:\Program Files\Java\Java3D\1.5.0\bin into the same two places I put the rxtx .dll files.

(One more to go...)

I copied j3d-org-java3d-all.jar from my workspace\Reprap\lib directory (which Eclipse had created for me earlier) to the same two places I copied all the other .jar files earlier.

FINALLY: I can launch eclipse and it builds and runs the RepRap host software!

I still lack ant, so I can't use the build.xml and build-user.xml stuff to create a Reprap.jar file. I could do that by hand after adding the JDK bin directory to by %PATH%, or I could track down and install a Windows build of ant, but... not just now.

So, it works. Phew! Now I can go to bed!

This stuff should be written up better and put into the Wiki, and the silliness of copying all those .jar and .dll files into two places needs to be understood and fixed. I think using the -vm parameter to eclipse will do that, but... well, I'm going to bed, testing that will need to wait!

Windows Java developers, go for it, please fix all our Java bugs while I sleep :-)

Jonathan
Anonymous User
Re: RepStrapper newbie Java troubles
June 14, 2007 04:16PM
I can't find the rxtx.zip, just rxtx-2.1-7.zip and how do you change compilers, as in change from 1.4 to 5.0, is this in eclipse? Building the hardware is easier than this software.
Re: RepStrapper newbie Java troubles
June 15, 2007 12:51AM
Englewood,

If you are not a Java programmer, *please* don't try to set up a software development environment (Eclipse, Subclipse, etc.). It's just extra complexity to confuse you, unless you really are going to further develop the software yourself. Just use the reprap-host-0.8.zip package plus the libraries.

There is only one rxtx zip file that is needed. I thought I posted a specific link to the relevant rxtx zip file last night, in my lengthy description post? Maybe not. It is definitely in the README file of reprap-host-0.8.zip . Anyway, it is at an FTP URL:

ftp : // ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip

(remove the spaces, which I added so that the forum software leaves my typing alone!). As a link, that is [ftp.qbang.org]

If that fails for you, use a real FTP client, or visit the www.rxtx.org site [www.rxtx.org] and click on Download and then look for the link from that page to this file.

I do hope to package up the libraries before too much longer. But surely, downloading two exe files and two zip files, (or three exes and a zip for development), then running the exes to install them, extracting a few files from inside the .zip and from where the installer put them and copying them somewhere is not really *that* hard, compared to building the entire mechanics and electronics of a Reprap...!!

It currently takes me under 30 mins to set up a full software and firmware dev env for Reprap under Linux, from scratch (assumes a suitable JDK is locally available on CD or similar). Even less time with my script to do it all for me!! It takes me maybe an hour under Windows, a big chunk of which is download time. It took me 2+ hours the first time (last night) partly because I was new to doing it in Windows, and partly because I was tired at the time I did it!

For comparison, it apparently takes Adrian 4+ hours to build just the cartesian robot... and I know I'll be *way* slower and clumsier than he is! Add the 6 electronics boards and the wires... there's just no way the time taken or level of complexity of the task is at all comparable, IMO.

You change the compiler Eclipse uses to handle "5.0" Java using the Project -> Properties menu and set Java Compiler to 5.0. But, if you don't already know Eclipse well enough to deal with that, you may want to use whatever programming editor or IDE you *are* familiar with instead?

Jonathan

Edited 1 time(s). Last edit at 06/15/2007 01:18AM by Jonathan Marsden.
Sorry, only registered users may post in this forum.

Click here to login