Welcome! Log In Create A New Profile

Advanced

Testers wanted: attempt at a host software development setup script

Posted by jmarsden 
Testers wanted: attempt at a host software development setup script
June 09, 2007 05:10PM
The current instructions on setting up a host software development environment are somewhat lengthy, and have been a source of confusion for some people. We're moving to "packaged" releases for end users, which is good. But what about developers?

I recently wrote a shell script that tries to do all the things you will need to get ready to develop and package the Reprap host software on a Linux machine. It does asume you have a working Java JDK installed, wget (so it can download stuff for you) and the svn command (well, and a text editor, if you're going to actually edit the .java sources once it is done!).

The script does everything else: it checks out the code from subversion, downloads needed libraries and installs them in the right place. It does *not* require or try to install Eclipse or Subclipse -- how you edit the Reprap host source code is left entirely up to you.

Cool? Well, it might be, if it worked reliably! For some reason it fails on Adrian's development machine, and we don't yet know why. It works for me here. I'm looking for a few more testers who are willing to try it out and report back what happens. By default it sets up the files in ~/projects/reprap so it will stay clear of any existing ~/workspace/stuff that you have set up following the wiki instructions in the past. If you want it to stick the files some other place, give it that other place (directory) as a parameter.

Here is the script... try it if you dare (!), and *please* let me know what happens when you do :-) If it eats your cat, just remember... *you* are the one who ran it!

Ahem... well... I can't seem to attach files in this forum...!

Here's a link to a copy of it: [www.box.net] -- click the link, then click the "Download" button to get the file. It is only 3.6kB.

Anyone with a Linux box can try this. No hardware needed, no skills needed besides download the file and being able to type

bash ./setup-reprap-host-dev-environment.sh

and letting me know what happens. I know it's a long filename to type... you can do it :-)

Thanks,

Jonathan
I just tried to run the script and it died with the following error:

A Reprap/build.xml
U Reprap
Checked out revision 658.
./setup-reprap-host-dev-environment.sh: line 54: javac: command not found
Exception in thread "main" java.lang.NoClassDefFoundError: home
./setup-reprap-host-dev-environment.sh: Error: BAD JRE DIR:

I currently am running Ubuntu 6.10 and had installed sun-java jre 5 I did not edit the installation script and didn't run it as root. I also chmoded it to 777...not that it should matter even though it isn't good practice.

If there is anything else I can tell you let me know and I will get right back to you.

Hope it helps,
David
Re: Testers wanted: attempt at a host software development setup script
June 16, 2007 12:58PM
davidmaulik wrote:

> I just tried to run the script and it died with the following error:

> ./setup-reprap-host-dev-environment.sh: line 54: javac: command not found

> ... I currently am running Ubuntu 6.10 and had installed sun-java jre 5 ...

There's the problem! My original post said:

>> It does asume you have a working Java JDK installed, ...

Note: That is JDK, not JRE. You are becoming a Java *developer*, so you will need the Java Development Kit, not just Java runtime.

(Note: if you don't intend to develop the Reprap host code, don't use this script, just download the reprap-host-0.8.zip package and the needed libraries instead).

If you do want to develop the Reprap host code, then I suggest:

$ sudo apt-get install sun-java5-jdk wget subversion
$ sudo update-alternatives --config java # Select the sun java 1.5.0 one!
$ sudo update-java-alternatives -s java-1.5.0-sun

This should help your Ubuntu setup to meet the requirements that I stated in my earlier post (perhaps not clearly enough, sorry about that). Then, please try running my script again, and let me know how it behaves :-)

[I have plans to enhance the script so that it can check whether it is running under Ubuntu, and if so do some or all of the above automatically, but I've not actually coded that enhancement yet! So far one person other than me has reported success with the current script, and one (Adrian) has reported failure.]

Thanks,

Jonathan
Re: Testers wanted: attempt at a host software development setup script
June 16, 2007 02:12PM
OK, here is a slightly enhanced version of the script. It tests for the presence of the tools it uses, such as unzip, wget, svn, java and javac, and displays an error if they are not found. If you run it under Ubuntu, it should also include in that error message a suggestion on how to use apt-get to obtain the missing piece of software concerned.

Jonathan

setup-reprap-host-dev-environment.sh
Thanks just tried it and it worked great. i knew that it would fail but I figured that even any input you could get would help.

David Maulik
Re: Testers wanted: attempt at a host software development setup script
June 17, 2007 06:59PM
> Thanks just tried it and it worked great.

Good, another satisfied customer!

So, now you are set up and able to work on the RepRap host code... which bugs are you planning on fixing?? :-)

Jonathan
also works for me (debian sarge with java and ant from tgz-package installed)

thanks
andreas
Re: Testers wanted: attempt at a host software development setup script
June 23, 2007 11:42AM
Great! Thanks for the report.

Maybe it's time to make this script "official", and commit it to Subversion / make it available for download at SourceForge?

Jonathan
Re: Testers wanted: attempt at a host software development setup script
June 23, 2007 09:38PM
yeah, that sounds good. lowering the barrier to development is always a good thing =)
This script worked for me too (Ubuntu 6.06).

The first time I ran it, I got an error because I had the wrong java vm selected, so I ran the update-alternatives commands to fix it (I had java-gcj selected before).

The second time I ran it , it reminded me to install ant which I had forgotten. Oops.

The third time it completed successfully. Nicely done.
Re: Testers wanted: attempt at a host software development setup script
June 24, 2007 04:19PM
Good. OK, I have committed this script.

Of course, since the idea is that you don't need to know all about svn to use it, this is a bit of a 'catch-22' way of making it available! Zach, maybe you can release it into FRS so it is directly downloadable from SourceForge?

Thanks,

Jonathan
Re: Testers wanted: attempt at a host software development setup script
June 25, 2007 08:33AM
how about linking to it directly from the software developer setup wiki page. something like this:

To setup your reprap development environment under linux, download and run this script:

# wget [svn.reprap.org]
# chmod +x setup-reprap-host-dev-environment.sh
# ./reprap-host-dev-environment.sh

I'd rather keep the sourceforge for binary type stuff, but if you'd rather that it be there just reply back to that effect and i'll do it.
Re: Testers wanted: attempt at a host software development setup script
June 26, 2007 12:58AM
That works. Actually, the brave could do:

$ wget -O- [svn.reprap.org] |bash

and get it done in a single command, as long as they trust me :-)

I'm starting to think we may want to create a host/scripts directory in Subversion for this and the packaging stuff, though, so the top level stays clean?

Jonathan
Re: Testers wanted: attempt at a host software development setup script
June 26, 2007 09:42AM
that sounds fine to me. making a scripts directory seems like a good idea to keep things clean. and who knows what new scripts we'll need in the future as well.
Re: Testers wanted: attempt at a host software development setup script
June 26, 2007 02:47PM
FWIW, this box is Ubuntu Dapper. Script failed with:

Exception in thread "main" java.lang.UnsupportedClassVersionError: home (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
./setup-reprap-host-dev-environment.sh: Error: BAD JRE DIR:
Check to make sure your versions of java are consistent. I think I had the same error initially because it was finding the javac from sun's jdk, but the 'java' interpreter was the free one that came with ubuntu that only supported earlier versions of java.

I ran:
sudo update-alternatives --config java
selected the sun jdk version I had installed, then
sudo update-java-alternatives -l
to list all the installed javas, then
sudo update-java-alternatives -s [name-of-the-sun-jdk-from-above]

Then erase the directories the script creates and run it again.

Edited 1 time(s). Last edit at 06/26/2007 03:10PM by emf.
Re: Testers wanted: attempt at a host software development setup script
June 26, 2007 05:12PM
This script expects that its user is going to become a Reprap host software developer. This means they need to already know how to program in Java under Linux (if they will use Windows, this script is probably not very useful to them, and it is untested on a Mac, though it might theoretically work on one). This means, IMO, that its user should already know what version of Java is installed, and how to ensure it is set up correctly.

James, if you are becoming a RepRap host software developer, great, emf's info on checking your java/javac versions applies.

If you just need to run the Reprap host software, don't try this script, which is intended only for software developers. Instead, use the reprap-host-0.8.zip package from SourceForge. You'll also need to install the libraries it needs by hand, at this point. There are detailed tested instructions on doing this at [reprap.org] , our RepRapLinuxSoftware page on the RepRap wiki.

I could probably do some testing of java and javac versions in the script, to try and catch this kind of issue more elegantly, but I think I'd end up accidentally encouraging end users to set their systems up for software development, which is not really the idea of this script.

If the issue is that the library installation part of this script is easier than the currently-described Wiki method, maybe I should break that part out into a separate library-installer script, and then edit the Wiki to suggest that Ubuntu and Debian users can use that script to get their libraries installed?

Jonathan
Re: Testers wanted: attempt at a host software development setup script
June 26, 2007 10:47PM
i think a library installation script would be a great first (second?) step towards making the reprap host software as easy as possible to install. if you're willing to do it, i'm willing to test it =)
Re: Testers wanted: attempt at a host software development setup script
June 26, 2007 11:13PM
speaking of testing, i finally got around to trying your script (i know... i've been super busy!) and it worked like a charm.
Re: Testers wanted: attempt at a host software development setup script
June 27, 2007 11:33AM
OK. Hopefully this weekend I'll break out the lib installer code as a separate script. I'm busy during the week at the moment with work and Spanish class (and attending a concert starring my son, last night!!).

Jonathan
Sorry, only registered users may post in this forum.

Click here to login