LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-27-2011, 10:49 PM   #1
rmknox
Member
 
Registered: May 2010
Posts: 354

Rep: Reputation: 34
I need some help understanding some java results. Fedora14


I need some help understanding some java results. I am not a java expert.

I am trying to run antelope from a download. Antelope is a java ant buildfile editor. I have run into a problem and would like to learn from solving it.

My understanding of the traceback below is that java complains that it can not find org.apache.tools.ant.input.InputHandler
. Maybe I don't interpret the trace-back correctly – my how complex they have become since the introduction of thrown exceptions.

I find the class Input.InputHandler in a number of ant.jar files. I have tried in various ways to point to these jar files – no result. In this case I extracted the class file from one of the jar files, put it in the same directory as the antelope.jar file and gave option -cp InputHandler – and still I get the same error.

Can someone give me some suggestions?

Dick

Code:
## here is what is in the directory

[knox@knox AntelopeApp_3.5.1]$ ls

AntelopeApp.jar  ChangeLog.txt  InputHandler.class  install.txt  javad  license.txt  preftool.preferences  run.xml


## here I invoke java

[knox@knox AntelopeApp_3.5.1]$ java -cp InputHandler -jar AntelopeApp.jar 


## here is what it says to me

ANT_HOME: /usr/share/ant/lib

JAVA_HOME: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre

Antelope debug log: /home/knox/antelope_debug.log

java.lang.reflect.InvocationTargetException

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

	at java.lang.reflect.Method.invoke(Method.java:616)

	at ise.antelope.launcher.SubJarClassLoader.invokeMainClass(Unknown Source)

	at ise.antelope.launcher.Launcher.runApp(Unknown Source)

	at ise.antelope.launcher.Launcher.main(Unknown Source)

Caused by: java.lang.NoClassDefFoundError: org/apache/tools/ant/input/InputHandler

	at java.lang.ClassLoader.defineClass1(Native Method)

	at java.lang.ClassLoader.defineClass(ClassLoader.java:634)

	at java.lang.ClassLoader.defineClass(ClassLoader.java:480)

	at ise.antelope.launcher.SubJarClassLoader.findClass(Unknown Source)

	at ise.antelope.launcher.SubJarClassLoader.loadClass(Unknown Source)

	at ise.antelope.launcher.SubJarClassLoader.loadClass(Unknown Source)

	at ise.antelope.app.Antelope.init(Unknown Source)

	at ise.antelope.app.Antelope.<init>(Unknown Source)

	at ise.antelope.app.Antelope.main(Unknown Source)

	... 7 more

Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.input.InputHandler

	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)

	at java.security.AccessController.doPrivileged(Native Method)

	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)

	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)

	at ise.antelope.launcher.SubJarClassLoader.loadClass(Unknown Source)

	at ise.antelope.launcher.SubJarClassLoader.loadClass(Unknown Source)

	... 16 more

[knox@knox AntelopeApp_3.5.1]$
 
Old 03-27-2011, 11:32 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Just a shot in the dark, but try this:
Quote:
java -cp . -jar AntelopeApp.jar InputHandler
or, better:
Quote:
java -jar AntelopeApp.jar

Last edited by paulsm4; 03-27-2011 at 11:33 PM.
 
Old 03-28-2011, 09:40 AM   #3
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
paulsm4

tried your "shot" and got the same result - both times

for what its worth, when I run javap on the InputHandler in the directory I get
Code:
[knox@knox AntelopeApp_3.5.1]$ javap -c InputHandler
Compiled from "InputHandler.java"
public interface org.apache.tools.ant.input.InputHandler{
public abstract void handleInput(org.apache.tools.ant.input.InputRequest)   throws org.apache.tools.ant.BuildException;

}
no bytecode and an abstract sub class - so as I understand it it requires an implementation of handleInput - but I dont know where to go with this
 
Old 03-28-2011, 10:05 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Please look at this link about Java "packages":
http://www.jarticles.com/package/package_eng.html

Two suggestions:
1. Try this syntax:
Quote:
java -cp . -jar AntelopeApp.jar org.apache.tools.ant.input.InputHandler
2. If that doesn't work, you might actually have to create a subdirectory "org/apache/tools/ant/input/" and copy your InputHandler.class file into it.

'Hope that helps .. PSM
 
Old 03-28-2011, 10:21 AM   #5
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
PSM

I tried the syntax and also the sub directories - exactly the same result.

thanks for the suggestions

dick

i will spend some time with the tutorial - it deals with issues i dont fully understand yet.
 
  


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
how to get G++ compiler in fedora14 ishak.live Fedora 3 01-25-2011 09:52 AM
understanding the java API nomenclature? Ryzol Programming 3 02-25-2008 11:09 PM
Ran cheops-ng, need help understanding the results Tortanick Linux - Networking 0 01-06-2007 09:28 AM
Understanding Java nerdstar04 Programming 2 08-16-2006 02:59 PM
java, help me i tried many things no results Laptop2250 Programming 9 10-26-2003 05:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:00 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
Open Source Consulting | Domain Registration