I'm working on trying to find a jar(s) file for the following imports. This is pertaining to a custom component for Oracle's UCM (Universal Content Manager). Two websites that come up no longer exist (findjar.com). I've been searching for possible code examples that would include the jars, but at this point, I have not found a solution. I've searched for websites that would aid me in finding the jar file that contains the class/path below. Is there another website that replaces findjar.com?
import intradoc.shared.*;
import intradoc.common.*;
import intradoc.data.*;
import intradoc.server.*;
import intradoc.resource.*
This file is available on the UCM server. You can locate it like this:
Log in as an administrator
Go to Administration / Configuration for ...
Expand class path details. There you will find something ending with wccontent/ucm/idc/jlib/idcserver.jar. That is the path on the server. Download that file and you have everything you need.
Related
I am using Eclipse IDE for Enterprise java and web developers. I downloaded some zip file called facts(1) and followed every step in setting up this facts project. When I try to run it on server it showing " ... doesn't match the expected package. I tried by adding import package facts; and also without that! I have also looked similar answer and didn't able to fix that either. FYI i have jdk (16.0.2) currently.
[enter image descripenter image description heretion here]2
enter image description here
As you are using default package for your facts classes like Fact.java, FactList.java, you do not need to import it.
However, I think your fact files Fact.java, FactList.java, etc are also failing compilation as the package declaration on those files are not same as the folder structure.
So please try these:
Make sure that there is no statement
package xxx.yyy.zzz;
in your fact classes Fact.java, FactList.java, etc and they are compiling successfully i.e. no errors in those files.
Remove the import statement in FactServlet.java as it is not required.
But.. according to Java standards using default package is not advisable. Create proper directory structure for your files.
you classes Fact.java, FactList.java, FactSearchModel.java and few more are in default package
create a package and move these classes to package, then import that package wherever required
I'm trying to use this library called OpenSimplexNoise, made by GitHub user TheCodingTrain. But I immediately discovered that I couldn't use it.
I did some digging to try to figure this out on my own, and I discovered that the JAR file and the main folder should have the same name (for example, the library file would be named OpenSimplexName and the JAR file would be OpenSimplexNoise.jar), and the folder the JAR file is in should be called "library." Once I fixed these issues, OpenSimplexNoise appeared in the "Import Library" menu in the "Contributed" section. But once I clicked it, a bunch of code appears:
import japplemenubar.*;
import processing.awt.*;
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.javafx.*;
import processing.opengl.*;
along with the error message:
More than one library is competing for this sketch.
The import japplemenubar points to multiple libraries:
core (C:\Program Files\Processing\processing.3.5.4\core)
OpenSimplexNoise (C:\Users**\Documents\Processing\libraries\OpenSimplexNoise).
Extra libraries need to be removed before this sketch can be used."
I tried removing japplemenubar, but the same issue appeared with processing.awt, so I tried removing that, but it just kept happening with each different import. I tried deleting it all and just typing "import processing.OpenSimplexNoise.*;", but it said "The import processing.OpenSimplesNoise cannot be resolved."
Does this mean that I'm just doing something wrong, or is this library no longer usable?
I recommend watching/following the videos linked in the README and understanding those:
https://youtu.be/pI2gvl9sdtE
https://youtu.be/U0TGZCEWn8g
The tutorials are how to put organize/compile a basic Processing library from scratch, not how to use library itself.
It would've been easier if a distribution zip would have been uploaded, but the point is learn how to generate it.
Downloading the library zip and unzipping in Processing won't work.
You need to:
(install eclipse if you haven't done so already as part of the video tutorial)
clone / download the project on your computer
Import the project into eclipse:
Drag and drop the build.xml file into the Ant panel: (in my view I've got multiple Processing libraries, you might have just OpenSimplexNoise)
Press the green Play Icon to run the build.
Initially I ran into this error:
BUILD FAILED
/Users/George/Documents/eclipse/OpenSimplexNoise-for-Processing/resources/build.xml:107: The following error occurred while executing this line:
/Users/George/Documents/eclipse/OpenSimplexNoise-for-Processing/resources/build.xml:141: /Users/George/Desktop/OpenSimplexNoise-for-Processing/lib does not exist.
Instead of trying to debug/fix the xml file I simply made the folder structure it wanted: a desktop folder named OpenSimplexNoise-for-Processing containing a lib folder.
Smooth sailing after this: BUILD SUCCESSFUL
Part of the ant build is copying the library to Documents/Processing/libraries so you can simply run the examples from there:
FWIW I've uploaded the compiled library here.
If simply wanted to use noise in Processing the built-in noise() function would do the trick.
If you want Simplex Noise without compiling Daniel Shiffman's example library you could try toxiclibs and it's toxi.math.noise package (also comes with an example sketch).
Am not using any IDE and trying to fix some errors for a deployed war file in tomcat. I am trying to look for source of a package and Erroneous line seems to require parameters and has been imported from some package like
import com.somefirm.somepackage.someClass;
Following questions did not have answer my question:
In eclipse determine which jar file a class is from
How can I find files imported in a java class
I want to know is there any way I can find source of import manually. Is it even possible or not? How does a class look for packages to import?
Edit 1: Separated the links with a newline.
Edit 2: "am not using any IDE at the moment" was a bit late in the question. SO added Am not using IDE to first line.
Edit 3: Provided more clarity to the question, as to why I am needing it.
Edit 4: Added these edits. Thanks to #Jude-niroshan and #ErwinBolwidt
The point is: the exact location of a class is determined by your class path setup.
You define at some point which classes are available when compiling your application respectively which classes to ship with it.
So, when you are not using an ide - you have to search the "elements" in the class path that gets applied for your build. For example by looking into each jar file.
Given your comments: I think you have to step back. You seem to lack basic knowledge of Java. You have to understand how that WAR file is built. There should be some sort of build description; containing the dependencies and other contents of the WAR delivery. You have to analyse those. Beyond that: if these packages are from your team/company/... a simple file search might do the job. If those packages are "external", like open source libraries - then you might try to simple google for the class name; or turn to grepcode.com.
And the other thing you asked: a compiled class contains only fully qualified class names. There are no import statements in class files any more. So when a class "needs" another class, it asks the JVM to load that class (given the fully qualified name). And the JVM simply looks into the classpath, and loads the first class that matches the given name.
I am trying to import and use PDFBox, but am having issues installing the jars I believe.
I am using Dr. Java, and I have added both the pdfbox-1.8.6.jar and the pdfbox-app-1.8.6.jar to my resource locations in my Extra Classpath.
However, it still is not recognizing the jars when I run the code:
import org.pdfbox.cos.COSDocument;
import org.pdfbox.pdfparser.PDFParser;
What other steps do I need to do in order for the jars to work?
Use the correct imports:
import org.apache.pdfbox.cos.COSDocument;
import org.apache.pdfbox.pdfparser.PDFParser;
Additional hints:
pdfbox-app-1.8.6.jar contains the classes from pdfbox-1.8.6.jar, so you don't need pdfbox-1.8.6.jar too
if you want to load a document for rendering or text extraction, you won't need these two imports. Loading is done with
import org.apache.pdfbox.pdmodel.PDDocument;
PDDocument doc = PDDocument.loadNonSeq(new File(filename), null);
To see how it is done, look at the examples in the source code. Good luck!
Have you tried the steps detailed on the documentation:
Adding And Removing JARs in DrJava
A JAR file is a way of storing many (pre-compiled) Java classes. Below
are instructions for adding and removing jar files from DrJava's
resource locations. For more information on JAR files, see our JARs
page and Using JAR Files: The Basics on Sun's site.
How to add a JAR
When you download the jar, keep track of where you save it to
Open DrJava
Edit > Preferences
Resource Locations (at left)
In Extra Classpath, Add (browse and chose the new jar)
Apply
Okay
Quit DrJava and re-open it in order for the change to take effect
I'm working through the example here:
http://www.vogella.com/articles/JavaPDF/article.html
In my file, I've got:
package com.mycompanyname.mydirectory;
import com.mycompanyname.OneOfMyClasses;
import com.itextpdf.text.Document;
...
public class MyClass {
...
}
Everything is working fine. What I don't understand is that since I just copied the import statement directly from the link above for the iText portion -- why does com.itextpdf.text.Document work?
I mean, if I look in directory com.mycompanyname I can see OneOfMyClasses.java there.
But in the com directly, there is no itextpdf directory (although maybe my user doesn't have permission to see it(?)).
Hoping someone can help me understand what I'm missing here. Doesn't the import point to a specific directory that I should be able to see the class? Is there a different com directory somewhere that iText is using, and com.itextpdf.text points to there? (if so, where's the directory located)?
I installed the jar file for iText in the lib folder as per usual, and made sure it was included in the classpath.
Those classes are inside a JAR file that is added to the classpath:
Create a new Java project "de.vogella.itext.write" with the package "de.vogella.itext.write". Create a folder "lib" and put the iText library (jar file) into this folder. Add the jar to your classpath.
import statements will look inside whatever directory trees are in the classpath, which includes the current directory at compilation time (tipically the src/ directory in your project) as well as any directory specified through environment variable or JVM startup parameter. See this about the classpath.
EDIT
You do need the imports whenever you use classes across packages. Every public class/interface you define is in a package. If whatever you are referencing belongs to another package, you need to import it.
JARs are zip files that contain directories and files inside. It's the same as plain directories and files, only packed.
It comes from the iText dependency (jar) you added in an earlier step.
Not necessarily - you could also import from libraries, etc.
In fact, Java will try to search through the classpath. Here is some helpful documentation.
That class is most probably imported in a JAR library. Inside such JAR file, the class files are kept in exact package/folder structure as you use when importing them.