LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-13-2011, 03:06 PM   #1
mab80
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Rep: Reputation: Disabled
javac problem


I have to convert a file .json in a twitter using TerrierPlugin dowloaded by the following link:
http://terrier.org/issues/secure/at...Plugin_v0.1.zip

I try to follow the guide: http://ir.dcs.gla.ac.uk/wiki/Terrier/Tweets11

I'm working on Linus Debian Squeeze and I setted all java variables as follows:

root@debian603# java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

root@debian603# vi /root/.bashrc
export JAVA_HOME:=/usr/lib/jvm/java-6-sun

root@debian603# ls -l /usr/lib/jvm/
totale 4
lrwxrwxrwx 1 root root 19 13 nov 14.18 java-6-sun -> java-6-sun-1.6.0.26
drwxr-xr-x 10 root root 4096 13 nov 14.19 java-6-sun-1.6.0.26


The problem is that when i run the command on dos I obtaint the following output:

root@debian603# ./bin/compile_package.sh italiano_2.json
************* COMPILING ***************
Setting TERRIER_HOME to /var/tmp/terrier-3.5
javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options



What can I do?
 
Old 11-13-2011, 07:20 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,269

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
compile_package.sh is a script. If you can follow it, execute the commands manually to figure out where it goes wrong. Most likely the file that you are giving it is not what it expects. Another possibility is that your environment is different than the author's in some way. Once you narrow it down, post back with the specifics.
 
Old 11-14-2011, 03:03 AM   #3
mab80
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
This is my compile_package.sh


#!/bin/bash
#
# -----------------------------------------------------------------

fullPath () {
t='TEMP=`cd $TEMP; pwd`'
for d in $*; do
eval `echo $t | sed 's/TEMP/'$d'/g'`
done
}

# -----------------------------------------------------------------

echo "************* COMPILING ***************"

if [ ! -n "$TERRIER_HOME" ]
then
#find out where this script is running
TEMPVAR=`dirname $0`
#make the path abolute
fullPath TEMPVAR
#terrier folder is folder above
TERRIER_HOME=`dirname $TEMPVAR`
echo "Setting TERRIER_HOME to $TERRIER_HOME"
fi

if [ ! -n "$JAVA_HOME" ]
then
#where is java?
TEMPVAR=`which java`
#j2sdk/bin folder is in the dir that java was in
TEMPVAR=`dirname $TEMPVAR`
#then java install prefix is folder above
JAVA_HOME=`dirname $TEMPVAR`
echo "Setting JAVA_HOME to $JAVA_HOME"
fi

if [ ! -n "$VERSION" ]
then
VERSION=`date +%Y%m%d`
fi

if [ "$*" == "0" ];
then
echo "No package specified"
echo "Usage: $0 packagename"
exit 1
fi

PRODUCT=$1
rm -f $TERRIER_HOME/lib/terrier-${PRODUCT}-*.jar
JARNAME=terrier-${PRODUCT}-$VERSION.jar
TMPDIR=$TERRIER_HOME/tmp_classes

#if [ ! -n "$CLASSPATH" ]
#then
# CLASSPATH=$TERRIER_HOME/src
#else
# CLASSPATH=$CLASSPATH:$TERRIER_HOME/src
#fi
for jar in $TERRIER_HOME/lib/*.jar; do
if [ ! -n "$CLASSPATH" ]
then
CLASSPATH=$jar
else
CLASSPATH=$CLASSPATH:$jar
fi
done

#pushd $TERRIER_HOME/src/uk/ac/gla/terrier/querying/parser &>/dev/null
#$JAVA_HOME/bin/java -cp $CLASSPATH antlr.Tool terrier.g
#popd $CURDIR &>/dev/null

BUILDSOURCE=$TERRIER_HOME/src_${PRODUCT}/

mkdir $TMPDIR
find $BUILDSOURCE -name '*.java' |\
xargs $JAVA_HOME/bin/javac -source 1.5\
-classpath $CLASSPATH \
-d $TMPDIR && \
$JAVA_HOME/bin/jar cfM $TERRIER_HOME/lib/$JARNAME \
-C $TMPDIR .
EXIT_CODE=$?

rm -rf $TMPDIR
exit $EXIT_CODE
 
Old 11-14-2011, 08:26 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,269

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
There's only one place where it runs javac, so at that point add echo statements to print all the variables and see what its doing.


Code:
echo Current directory `pwd`
echo BUILDSOURCE $BUILDSOURCE 
echo JAVA_HOME $JAVA_HOME
echo CLASSPATH $CLASSPATH 
echo TMPDIR $TMPDIR 
echo TERRIER_HOME $TERRIER_HOME
echo JARNAME $JARNAME 

find $BUILDSOURCE -name '*.java' |\
	xargs $JAVA_HOME/bin/javac -source 1.5\
		-classpath $CLASSPATH \
		-d $TMPDIR && \
$JAVA_HOME/bin/jar cfM $TERRIER_HOME/lib/$JARNAME \
		-C $TMPDIR .
 
Old 11-14-2011, 02:10 PM   #5
mab80
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Ok. Thanks.
I found that the problem is on the line xargs $JAVA_HOME/bin/javac ...

But do you know how I can correct it?
 
Old 11-14-2011, 02:13 PM   #6
mab80
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
The error that I have is:

javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
javac problem manolakis Linux - Newbie 11 01-19-2007 03:07 AM
gcj javac instead of jdk javac rvindiola Linux - Newbie 2 03-29-2006 09:18 PM
J2sdk problem Javac command not found CollestonPie13 Linux - Software 3 02-15-2004 12:30 PM
problem with javac command mekasrinu Programming 2 06-12-2001 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration