Hi,i want to use this ClassParser to parse another file(class) in another package , in my code i used ClassParser to parse only existing file (class) in existing package ,,,how can i use it to parse any file and from any package ,if i can't use it ,is there any other way or parse to do this in java. This is the code that have parser that previously talking about it. package javaapplication12; public class CyclomaticComplexity { ClassParser parser=new ClassParser(CyclomaticComplexity.class.getResourceAsStream("/javaapplication12/CyclomaticComplexity.class"),"CyclomaticComplexity.class"); JavaClass javaClass=parser.parse();} Now,if i want to parse another file (ex. Class filename in package filename )how can do this? /filename/filename.class …

Member Avatar
+0 forum 0

hello!I install tomcat server and set CLASSPATH variable `servlet-api` and my servlets running properly but when i compile and run my old program program of `java 2 SE` then it compile successfully but not run it prints an error message G:\Java>javac BinarySearchDemo.java G:\Java>java BinarySearchDemo Error: Could not find or load main class BinarySearchDemo G:\Java>pause Press any key to continue . . . what is problem??????

Member Avatar
Member Avatar
+0 forum 6

Hey everyone, So i've been doing some reasearch and I can't seem to find the answer to my problem anywhere. It could also be that I don't really understand the articles I find in google but I figured I'd ask here since everyone is always so helpful. So for a class we were told to design an app. Could be anything we wanted. So, being the twitter freak I am, i wanted to make a java twitter app. So i downloaded some libraries (TwitterJ4) but I don't know what to do with them. We are not allowed to use a …

Member Avatar
Member Avatar
+0 forum 1

I have been working with Java a longtime, but my main problem is this. Everytime i try to set my classpath, set my path variables, all works well, until i think of adding a new package from elsewhere. Disaster breaksout, such that i have to recode the entire package for it to be added into my Windows projects. this is in Windows set %classpath% =. Where am i going wrong????

Member Avatar
Member Avatar
+0 forum 2

I have a question in SCJP text book by Kathy Sierra and Bert Bates in Development chapter. Q. Given the default classpath: /foo And the directory structure: foo | test | xcom |--A.class |--B.java And these two files as mentioned in the code snippet section. Amongst the choice, 1. javac -classpath . xcom/B.java 2.javac -classpath xcom:. B.java Correct answer is option 1. But my doubt is that isn't option 2 going to perform same operation? If not, what is the difference between the two syntax?

Member Avatar
Member Avatar
+0 forum 1

Even after setting all the paths correctly, I get an error saying the "setclasspath.sh" cannot be found. I checked the directory and it was there. I then changed the permissions using chmod +x setclasspath.sh but to no avail. I've changed the permissions of all the files inside the "bin" directory but it's not working. Please help. [code=text]ash@Megadeth:~$ JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk ash@Megadeth:~$ export JAVA_HOME ash@Megadeth:~$ JRE_HOME=/usr/lib/jvm/java-1.6.0-openjdk/jre ash@Megadeth:~$ export JRE_HOME ash@Megadeth:~$ PATH=/usr/lib/jvm/java-1.6.0-openjdk/bin:$PATH ash@Megadeth:~$ export PATH ash@Megadeth:~$ CLASSPATH=$PATH:$CLASSPATH ash@Megadeth:~$ export CLASSPATH ash@Megadeth:~$ CATALINA_HOME=/home/tomcat/tomcat1 ash@Megadeth:~$ export CATALINA_HOME ash@Megadeth:~$ cd tomcat/tomcat1/bin ash@Megadeth:~/tomcat/tomcat1/bin$ ./startup.sh Cannot find /home/tomcat/tomcat1/bin/setclasspath.sh This file is needed to run this program ash@Megadeth:~/tomcat/tomcat1/bin$[/code]

Member Avatar
Member Avatar
+0 forum 1

I want to attach User Instructions to a Java application, and allow the user to open it from the help menuitem. I'm not very familiar with classpath variables. If I use an absolute path name everything is fine, such as File pdfFile = new File("C:/Program Files/MyProgram/UserGuide.pdf"); But I want to package the UserGuide in the jar file (to avoid issues openning it on a Mac or Linux machine, and prevent the user from deleting it etc.). So I want to access it using File pdfFile = new File("files/UserGuide.pdf"); where files is a directory in the package where the main method's …

Member Avatar
Member Avatar
+0 forum 4

Just wondering is there any way to modify Classpath in your program and force them to include a new directory in classpath ??

Member Avatar
Member Avatar
+0 forum 5

hello all i m writing a script in which i am trying to set classpath using this export CLASSPATH=$CLASSPATH:/usr/java and then i run the script But nothing is added in the bash_profile

Member Avatar
Member Avatar
+0 forum 10

From my home directory, I created a directory [B]pkg[/B] and wrote 2 files [B]A.java[/B] and [B]B.java[/B] in it. [B]A.java[/B] [CODE]package pkg; class A { B b; }[/CODE] [B]B.java[/B] [CODE]package pkg; class B { }[/CODE] I went back to my home directory and typed the following : [CODE]javac -classpath . /pkg/A.java[/CODE] It compiled correctly. My question is that A.java has a reference to class B. The compiler searches the classpath for any packages that contains class B. [B]pkg[/B] being the only package in the classpath, it doesn't find the B class file there. It should have been the end of story …

Member Avatar
Member Avatar
+0 forum 12

The End.