Archive for the ‘Java’ category

Hudson: File “tests/run.py”, line 48, in ?

October 8th, 2010

[hudson@manoj ~]$ python /data/hudson/.hudson/jobs/pygments/workspace/tests/run.py –with-xunit
Pygments 1.3.1 test suite running (Python 2.4.3)…
Traceback (most recent call last):
  File “/data/hudson/.hudson/jobs/pygments/workspace/tests/run.py”, line 48, in ?
    nose.main()
  File “/usr/lib/python2.4/site-packages/nose/core.py”, line 116, in __init__
    argv=argv, testRunner=testRunner, testLoader=testLoader,
  File “/usr/lib64/python2.4/unittest.py”, line 758, in __init__
    self.parseArgs(argv)
  File “/usr/lib/python2.4/site-packages/nose/core.py”, line 134, in parseArgs
    self.config.configure(argv, doc=self.usage())
  File “/usr/lib/python2.4/site-packages/nose/config.py”, line 323, in configure
    self.plugins.configure(options, self)
  File “/usr/lib/python2.4/site-packages/nose/plugins/manager.py”, line 270, in configure
    cfg(options, config)
  File “/usr/lib/python2.4/site-packages/nose/plugins/manager.py”, line 93, in __call__
    return self.call(*arg, **kw)
  File “/usr/lib/python2.4/site-packages/nose/plugins/manager.py”, line 161, in simple
    result = meth(*arg, **kw)
  File “/usr/lib/python2.4/site-packages/nose/plugins/xunit.py”, line 149, in configure
    self.error_report_file = open(options.xunit_file, ‘w’)
IOError: [Errno 13] Permission denied: ‘nosetests.xml’
[hudson@manoj ~]$ python /data/hudson/.hudson/jobs/pygments/workspace/tests/run.py –with-xunit
[hudson@manoj ~]$ cd /data/hudson/.hudson/jobs/pygments/workspace/tests
logout

I have fixed it by changing the permission of /data/hudson/.hudson/jobs/

[root@manoj ~]#  chmod -R 777 /data/hudson/.hudson/jobs/

——
[hudson@manoj ~]$ python /data/hudson/.hudson/jobs/pygments/workspace/tests/run.py –with-xunit
Pygments 1.3.1 test suite running (Python 2.4.3)…

———————————————————————-
Ran 0 tests in 0.002s

OK

How do I set my java classpath?

February 21st, 2010

Problem
Linux uses Red Hats java package instead of the Sun jdk.

Reason
The java interpreter from the standard Red Hat installation is placed in /usr/bin, which is in the path where Linux search for executables. This will be used be default if you don’t specify otherwise.

To find the java classes, you also have to set the java classpath to point to the java kit you want to use.

Solution
Set your PATH and CLASSPATH environment variables to reflect which java kit you want to use.

In the ITU Linux machines in 2003, the following java kits are installed: jdk1.3.1 and j2sdk1.4.1. They are placed in /usr/java.

To use jdk1.3.1, add the following lines to the file “.bashrc” in your home directory:

export PATH=/usr/java/jdk1.3.1/bin:$PATH
export JAVA_HOME=”/usr/java/jdk1.3.1″
export CLASSPATH=.:/usr/java/jdk1.3.1

If you want to use the j2sdk1.4.1, replace jdk1.3.1 with j2sdk1.4.1 and it should work.

Thanks
Manoj Chauhan