Link to home
Start Free TrialLog in
Avatar of copyPasteGhost
copyPasteGhostFlag for Canada

asked on

oracle's Jdeveloper and compling issuses

Hello all,

I have this problem when trying to complie classes with Jdev. I installed the jsdk ver 1.4.2. I know that works cause I was able to install tomcat and serve up some jsp comtent. I don't think there is a problem with my sdk install..

I installed jdev yesterday as well. but I'm having this problem.. I can't complie.. jdev claims that I'm missing files.. mainly all the xml classes and even the com.set.rowset. those files are being imported but they are not being seen..

I think the problem is that I must somehow let jdev know that I have those jars and then use them.. But I don't know how to do this. I tried to set up a class path directly to the src.zip file and even pointing to the xml classes within this zip...Nothing.


if anyone can help that would be great...time is a factor since if I can't complie I really can't do anything.
thanks,
Ghost
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

The easiest way to let it know is probably to copy those jars into all lib\ext directories on your system
Avatar of copyPasteGhost

ASKER

can you give me an example to do this..

the net beans ide doesn't work either just to let you know...as well as textpad....it seems nothing can understand were the rowset jar is...

I'm using this import..

import com.sun.rowset.*;
 
and nothing..
any suggestions?
Ghost
An example? You just need to copy it into the right places. Give me the directory listings of your lib\ext directory (ies)
Does your project classpath include the jars in question?
Well obviously not o - or it would work ;-) My suggestion simply makes it easier in a way to find them system-wide
I actually gave up on that jar stuff..

I figured out that you have to mount jars in net beans to get it to work... So I'm doing it that way...

I have another question ...not really related to this..


    String className = "TestFunction"; //string reprensentation of class
    String methodName = "addTwoNumbers"; //string representation of method

    Class xClass = Class.forName(className); //create Class instance
    Method xMethod = xClass.getMethod(methodName, null); //create Method instance

    Object xObject = xClass.newInstance(); //create an object of class
    System.out.println(xMethod.invoke(xObject, null)); //invoke the method on that object

can you explain to me what this code is supposed to do.. I mean the class for name stuff ....the rest I kinda get.

also would this code be the same as creating an object of that type?
thanks guys,
Ghost
>>I figured out that you have to mount jars in net beans ..

Yes, but jars in lib/ext will be found automatically for all projects

Your example?
It's loading a class dynamically

>>also would this code be the same as creating an object of that type?

Yes
The Class.forName() loads the class template into memory, but does not create an object of the type!
very very cool.. thanks to the both oh you.

>>cehj
I tried to add the jars to the lib folder

a ext subfloder did not yet exisit I made one and tried that as well and still nothing on all of my other ides.... I wonder why

messed up??
any suggestions...cause I really hate net beans :p
thanks
Ghost
If an ext sub-folder does not exist, you don't need to create it. If its not there, then you might just need to put the JARs in some other folder from where they'll be recognized. Basically, every IDE or server uses its own classpath.
Oh, you're using netbeans. all you need to do is mount the jars in the file systems tab and then (depending on the version of nb) add the jar file system to your project (version 3.5 and earlier), or do nothing (version 3.6)
>> the net beans ide doesn't work either just to let you know...as well as textpad

BTW, TextPad uses system classpath. For that, you need to add all the required JARs to the System classpath (I'm assuming you know how to do that).
>>a ext subfloder did not yet exisit

If that's the case after you did a search of your entire file system, you must be using an early version of Java, in which case you should probably upgrade. Creating one won't help
Avatar of vzilka
vzilka

For JDev, I do not the the lib/ext directory trick will work, as JDev has its own JRE, (it is called OJRE, Oracle JRE).
You need to set your project classpath to the 1.4 JVM, or edit your jdev.conf file (found in JDeveloper\jdev\conf) and edit the path of your JVM.
You might recieve an error message during startup, but you can ignore it.
I noticed that just adding the jars into this folder
C:\j2sdk1.4.2\jre\lib\ext

does not do anything. Do I have that wrong? So far the only way that I got it to work with jdev is to edit the class path internally that is..

project --> project settings -->configurations -->development -->paths and then add addtional class paths

so the only question that remains is where can I just drop off jars and have then recongized by my ides...

Oh I realised I get the same trouble when I try to import javax.servlets.*;
does anyone how were I can download the jars for that and set that up nicely?
thanks
Ghost
>> C:\j2sdk1.4.2\jre\lib\ext

That is the JDK folder. Putting the JAR there might help if you're compiling from the command prompt but not if you're compiling from JBuilder.

Almost every IDE and server uses its own classpath (which is different from the system classpath). So with JBuilder, the correct way to do it is to use: >> project --> project settings -->configurations -->development -->paths and then add addtional class paths.

>> I realised I get the same trouble when I try to import javax.servlets.*;

The servlet.jar file also needs to be in the IDE's classpath, I guess.
The servlet.jar file is supposed to be part of the JDev default library. In JDeveloper you have not only classpath, but also libraries, which is a group of predefined classpath.
Just add the servlets library to your project.
so there is no way around that. you have to put the jars in each class path...
too bad you can't just put it in a catch all folder and just have all the ides read from it..
thanks for your help anyways...
Ghost
SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial