Solved

oracle's Jdeveloper and compling issuses

Posted on 2004-04-07
21
328 Views
Last Modified: 2011-10-03
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
0
Comment
Question by:copyPasteGhost
  • 5
  • 5
  • 5
  • +2
21 Comments
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
The easiest way to let it know is probably to copy those jars into all lib\ext directories on your system
0
 
LVL 13

Author Comment

by:copyPasteGhost
Comment Utility
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
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
An example? You just need to copy it into the right places. Give me the directory listings of your lib\ext directory (ies)
0
 
LVL 14

Expert Comment

by:Tommy Braas
Comment Utility
Does your project classpath include the jars in question?
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
Well obviously not o - or it would work ;-) My suggestion simply makes it easier in a way to find them system-wide
0
 
LVL 13

Author Comment

by:copyPasteGhost
Comment Utility
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
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
>>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
0
 
LVL 14

Expert Comment

by:Tommy Braas
Comment Utility
The Class.forName() loads the class template into memory, but does not create an object of the type!
0
 
LVL 13

Author Comment

by:copyPasteGhost
Comment Utility
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
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
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.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
0
 
LVL 14

Expert Comment

by:Tommy Braas
Comment Utility
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)
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
>> 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).
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
>>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
0
 
LVL 9

Expert Comment

by:vzilka
Comment Utility
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.
0
 
LVL 13

Author Comment

by:copyPasteGhost
Comment Utility
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
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
>> 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.
0
 
LVL 9

Expert Comment

by:vzilka
Comment Utility
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.
0
 
LVL 13

Author Comment

by:copyPasteGhost
Comment Utility
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
0
 
LVL 30

Assisted Solution

by:mayankeagle
mayankeagle earned 60 total points
Comment Utility
>> you have to put the jars in each class path...

That is what the significance of classpath is: http://www.mindprod.com/jgloss/classpath.html

>> you can't just put it in a catch all folder and just have all the ides read from it..

Not quite sure what you mean by "catch all folder" ?
0
 
LVL 9

Accepted Solution

by:
vzilka earned 90 total points
Comment Utility
Again. Use JDeveloper library concept. THen you just select a library to add - and that's that. It contains a list of JAR files that are added automatically to your project.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now