Welcome! Log In Create A New Profile

Advanced

Java version and missing pre-req

Posted by davidgoodenough 
Java version and missing pre-req
October 27, 2008 07:11AM
I saw Adrian's note about the new code, and I thought I would give it a go. Previously I had only used the released binaries, not the source.

So I went through the install instructions for Linux, I already had Eclipse (by the way the example shown is very old, I am using Ganymede SR1 and it works well) and I noticed that in some places it talks about Java 1.4, in others 1.5. It strikes me that it would be better to move to OpenJDK (effectively Java 6) firstly because it is more "open source", and secondly because it gets around the next problem. Its also faster and better in other ways and runs on lots more platforms.

The next problem I hit is that the new code seems to need org.jdesktop.layout.GroupLayout, and the Jar for that is not in the pre-req list. Now if we were using Java-6 (either Sun or OpenJDK) this would not be a problem (although it would need changing the package name) as it is part of the core Java Swing libraries now.
Re: Java version and missing pre-req
October 27, 2008 07:34AM
BTW, if we are going to move to at least 1.5 and the minimum, then we can tidy up (and I am very happy to do this - I have done it on many projects over the years) many of the warnings due to the lack of Generics on things like ArrayLists.
Re: Java version and missing pre-req
October 28, 2008 09:55PM
I get about 100 org.jdesktop.layout.GroupLayout errors, how did you fix it? I have java 1.5 installed. Thanks
Re: Java version and missing pre-req
October 29, 2008 06:13AM
Download the jar from swing-layout.dev.java.net and include it in your classpath (it can be put in jre/lib/ext).

The proper solution is to move to Java 6 where it is part of the package but that requires source changes because the package changes.
Re: Java version and missing pre-req
October 29, 2008 08:09PM
thanks that workaround worked!

I did setup-reprap-host-dev-environment.sh

and then ~/projects/reprap/Reprap$ ant run

but the java app doesn't look like the multimode host from the blog post, did I run the wrong commands?

Thanks again
Re: Java version and missing pre-req
October 30, 2008 06:03AM
Are you sure you were using the new jar file? It certainly generated the new UI when I tried it.

BTW, I have generated a patch to move to using Java 6 GroupLayout (the one now in the Swing package). Once I have tested it I will post it here.
Re: Java version and missing pre-req
October 30, 2008 08:24AM
No, I'm not sure how to tell?

I just checked out [reprap.svn.sourceforge.net] and did the commands I posted about
Re: Java version and missing pre-req
October 30, 2008 09:41AM
You need to check the shell script/batch file that is running the host program, and make sure it is picking up the right jar.
Re: Java version and missing pre-req
October 30, 2008 01:32PM
I have managed to clear all the warnings from the compilation of the RepRap host code. If anyone wants it I can generate a diff (which will also switch to using the Java-6 GroupLayout).
Re: Java version and missing pre-req
October 30, 2008 08:22PM
I'm still missing something...

I only have one jar file being created using an up to date svn. Are there instructions anywhere? Where is the multimode host jar supposed to be? the jar thats created in the jar directory is the old one.

Thanks for the help
emt
Re: Java version and missing pre-req
November 17, 2008 03:57AM
Hi David

You say:-

"Download the jar from swing-layout.dev.java.net and include it in your classpath"

Can you give a link to the actual Jar file as I could not locate it. Probably can't see the wood for the trees.


Regards

Ian
Re: Java version and missing pre-req
November 17, 2008 04:39AM
Go to Documents and Files, and select release 1.0.3
Sorry, only registered users may post in this forum.

Click here to login