Am am trying to work through the Using java in R5 course manual but am stuck on creating a java app to access domino data. the error im getting is on the import line and is as follows:
package lotus.domino does not exist
import lotus.domino.*; is the top line of the class file ?
the classpath environment variable is as follows:
.; C:\j2sdk1.4.2_08\lib\classes.zip; C:\Program Files\lotus\notes\notes.jar; C:\Program Files\lotus\notes\data\domino\java\ncso.jar;
This query has been posted in the R4 / R5 forums but I can’t find a solution. Ive just tried using eclipse to edit the Java rather than notepad but had no luck with that either even tho it allowed me to import the jar file… need help!
Subject: package lotus.domino does not exist
Ok it now works, I had the notes.jar before the ncso.jar in the CLASSPATH. However it now compiles but upon trying to run the Java I get a java.lang.NoClassDefFoundError! This is driving me nuts now
Subject: RE: package lotus.domino does not exist
java.lang.NoClassDefFoundError indicates the VM does not find the standard Java System libraries. Check your classpath again, make sure your Java\bin folder is included in there.
Subject: RE: package lotus.domino does not exist
Java\Bin ? The classes are all in java\lib arn’t they ? I have the Java\bin in my class statement and ive been compiling and running normal java programs with no problem. Just connecting to a local notes db thats now giving me problems
Thanks again
Mark
Subject: RE: package lotus.domino does not exist
Try adding .;c:\jdkfolder\bin;c:\Program File\lotus\notes;
to the PATH (not CLASSPATH)Environment Variable so that the O/S can find all the java and notes executables.
Subject: RE: package lotus.domino does not exist
hi robert,
the notes\data is in the class variable already. thanks for the suggestion tho
mark
The code im trying to run is :
import java.awt.*;
import java.awt.event.*;
import lotus.domino.*;
public class Activity06 extends Frame implements WindowListener, Runnable {
NotesThread t;
static Label Label1;
public static void main(String args[]) {
try {
Activity06 t = new Activity06();
NotesThread nt = new NotesThread(t);
nt.start();
} // end try
catch (Exception e) {
e.printStackTrace();
}
} // end main method
public void run() {
try {
Session s = NotesFactory.createSession();
System.out.println("User Name: " + s.getUserName());
} // end try
catch (Exception e) {
e.printStackTrace();
} // end catch
} // end Run Method
public void windowClosing(WindowEvent e) {System.exit(0);}
public void windowActivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowOpened(WindowEvent e) {}
} // end class
Subject: package lotus.domino does not exist
You’ve got spaces in the classpath:
Open a CMD prompt.
Type “set classpath =.;C:\j2sdk1.4.2_08\lib\classes.zip;C:\Program Files\lotus\notes\notes.jar;C:\Program Files\lotus\notes\data\domino\java\ncso.jar;”
Try to run your code. Assuming you’re running your code from the CMD line
Type “javac C:\j2sdk1.4.2_08\lib\javac MyClass.java”.
Then type “java MyClass”.
You can also use the java -cp or java -classpath to specify a classpath at runtime (e.g., java -cp “.;./Test Code” MyClass).
And incidentally, you don’t need Notes.jar in the classpath if you’re accessing the server over CORBA/DIIOP.
hth,
dgg
Subject: FIXED
Dallas, thanks for the help. It turns out there was a space in my CLASS variable between the ; and next c:. Took this out and its now (at last) working!
Thanks to everybody who took the time to have a look
Mark