Class-Path: for Windows
I have a jar I created with manifest which contains a set of jar files as such:
Class-Path:
file:///c:/someDir/a.jar
file:///c:/some other dir/b.jar
When I try to access a class within b.jar, I always get a NoClassDefFoundError. If relocate the jar and rebuild the manifest so that the path does not include blank characters, then I find the class with no problem.
I have tried create the jar with the manifest as shown above, and I have tried using %20 in place of the blanks, but it still does not work:
file:///c:/some%20other%20data/b.jar
Class-Path Entries are relative to the Parent-Path of the JAR they're contained in.
Assume your JAR's URL is "file:///c:/anydir1/anydir2/JarWithClassPath.jar" then the Parent-Path is "file:///c:/anydir1/anydir2/". All Class-Path Entries are interpreted relative to this location.
See:
http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html#applications
Similar Messages
-
How to set class path for mysql
hai, I have been trying to make a java program read from mysql database. but i don't know how to set the class path for mysql-connector-java-5_1_.0.6-bin. i set the class path in system variable as C:\Program Files\Java\jdk1.5.0_08\jre\lib\ext\mysql-connector-java-5_1_.0.6-bin.
in the command prompt, i compile C:\javac abc.java and run java abc.
when run it come out error java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
i am using Window xp. can anybody help me??? TQ.hai, I have been trying to make a java program read
from mysql database. but i don't know how to set the
class path for mysql-connector-java-5_1_.0.6-bin. i
set the class path in system variable as C:\Program
Files\Java\jdk1.5.0_08\jre\lib\ext\mysql-connector-jav
a-5_1_.0.6-bin.
in the command prompt, i compile C:\javac abc.java
and run java abc.
when run it come out error
java.lang.ClassNotFoundException:
com.mysql.jdbc.Driver
i am using Window xp. can anybody help me??? TQ.Right click on my computer icon,
Goto properties->advanced->environment variables.
Look for 'classpath' under system variable.
Select it and click edit.
put ';' and path of the mysql connector jar at the end
suppose if u have jar file under d:/driver/mysqlconnector.jar
thn put this value in variable value text box
;d:/driver/mysqlconnector.jar
or simply put ur driver jar file in jre/lib/ext folder
D:\j2sdk1.4.2_03\jre\lib\ext
[Servlet tutorial|http://www.jsptube.com] -
How do I set class path for 3rd-party classes?
Hello, I need to know how to set the classpath so that I can use the apache's third-party lang classes. I downloaded commons.apache.org/lang/download_lang.cgi. And I need to know next steps. Move the unzipped files to which location? And type what commands?
Thanks, MelissaHi, it's not the server that I am running. My instructor told me to download an apache class file for the Apache Lang library and then set my class path to point to the executable. Her instructions are for Windows users, however. I need to do something in the terminal shell but I don't know precisely what.
mg -
File Path for Windows and Linux
hi can any one give solution how to implement code for odi file copy .
i am using Same Code for Windows and Linux
OdiFileCopy "-FILE=#Var_Lookup_File_Path \ Employee.csv" "-TOFILE=#Var_Lookup_File_Path_Backup\Employee.csv" "-RECURSE=NO" "-OVERWRITE=YES" "-CASESENS=NO"
the problem of above code is
it is working in windows but my Prod is Linux environment.
in linux \ not works.. / will work
please suggest how to concatnate variable and file without' \' '/'Thanks Phani
i think in OS command also we may give path like #variable\File Name.
So how it will replace \ with / in Linux.
Could you give code for my Scenario..
Thanks for helping -
Class path for parser not working
The following were not found in my import when i build the program:
import org.w3c.dom.*;
import org.xml.sax.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
I thought this problem would be solved by having a SAX parser(sax2r2).
I set the class path as follows:
SET PATH=%PATH%;%JAVAHOME%\BIN
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;
C:\jdk1.3\lib\bin
C:\jdk1.3\lib\sax2r2.jar;
sax2r2.jar is placed in the correct folder.
What could be the problem?
CheersYou set the PATH like that. If you want to set the CLASSPATH then you need to set the CLASSPATH variable.
-
Set the path and class path in windows xp professional
hi guys....could any one tell me step by step on how to set the path and classpath on windows xp professioanl? This is my path and classpath
set path = %path%;C:\jdk1.3.1_02\bin;c:\JOpen672.jar;c:\
set CLASSPATH = c:\j2sdkee1.3.1\lib\j2ee.jar;c:\JOpen672.Jar;c:\;c:\postgresql.jar;c:\jai_core.jar
not working please help me on this thanks alot.
noviceproBelow is a Helloworld program, copy and paste it into your editor and save it as "HelloWorld.java" Use capitalization, Java is case-sensitive. If you're using Notepad, quote the name when saving, otherwise Notepad adds ".txt" to the name. Go to DOS and check that you've got the file where you want it and that it's named correctly.
----------program HelloWorld.java--------------
public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello World!");
In the same directory as HelloWorld.java, enter "javac" - the program should print out a list of options, if not, set your PATH - see below.
In the same directory as HelloWorld.java, enter "javac HelloWorld.java" and the javac compiler will create HelloWorld.class. If it was successful it will not give any messages. Check that the file is created.
In the same directory as HelloWorld.java, enter "java -cp . HelloWorld" with the spaces and the period. The program will run.
Here is additional information:
The Path is a set of pointers that Windows uses to locate programs that you execute, like javac.exe and java.exe. This setting is explained here:
http://java.sun.com/j2se/1.4/install-windows.html
Scroll down to: 5. Update the PATH variable
(you should have already done this as part of the s/w installation)
The CLASSPATH is another set of pointers that is used by Java to find the files that you create and want compiled and/or run. This setting is explained here:
Setting the Classpath:
http://java.sun.com/j2se/1.4/docs/tooldocs/windows/classpath.html
[NOTE: always start your classpath with ".;" which means the current directory. See my classpath, below]
How Classes are Found:
http://java.sun.com/j2se/1.4/docs/tooldocs/findingclasses.html
Examples:
This is my path
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.0_01\BIN;C:\PROGRA~1\UTILIT~1;C:\PROGRA~1\WIN98RK
This is my classpath
CLASSPATH=.;C:\mjava;C:\mnrx;C:\NetRexx\lib\NetRexxC.jar;C:\j2sdk1.4.0_1\lib\tools.jar;C:\NetRexx\NrxRedBk -
Java Class path for Oracle package compilation
Hello
I am trying to send mail with file attachment, this part is
done by java program, it is compiled & working fine.
I am trying to compile the same java program at SQL prompt so
that I can build a package to execute that Java program from
Oracle. As java prog requires other class files
(javax.mail.*,javax.mail.internet.*,javax.activation.*) to be
include , those class path is set at their respective location
of OS.
Other Java programs are compiling fine from SQL but for this
mail prog, it is giving error as it is not finding the location
of the include files.
Can anyone tell me from which class path does Oracle 8i compiles
Java program ? any additional information reqdng this issue ?
thanksHello Suresh Vemulapalli
Thanks for replay & suggestion, I compiled using loadjava on
OS & it is working fine
regards
Prakash K.B. -
How to set (class)paths for a Managed server?
How does one configure the PATH and CLASSPATH and pass definitions (like "-Djava.library.path=c:\p\bea\wlserver6.1\bin")
to a remotely-started managed server?
The section in the WLS 6.1 AdminGuide.pdf that talks about configuring a managed
server's Remote Start tab says on pages 3-9 to 3-10 that, "If you don't specify
values for these fields and attempt to start the target server from the Administration
Console, the Node Manager will attempt to start the target server with the values
for these attributes that were used when starting the Node Manager. The Node Manager
will be able to start the Managed Server in that case if you specified the required
values on the command line when starting the Node Manager."
So it sounds as if I can get the java.library.path definition and CLASSPATH sent
to the server via the Node Manager startup command.
Does that work when using the Node Manager as an NT Service? Here is my Win2K
command file for setting up the Node Manager as an NT Service. Note that I'm trying
to tell it where to find the Windows native libraries (wlserver6.1\bin for wlntio.dll)
and the JDBC drivers (C:\SHADOW\jdbc\... and C:\Orant\jdbc\... ) :
========== BEGIN installNMNtService.cmd ================ @echo off
SETLOCAL
cd C:\p\bea\wlserver6.1\
rem *** Set Classpath to load Weblogic Classes
set CLASSPATH=.;C:\p\bea\wlserver6.1\lib\weblogic_sp.jar;C:\p\bea\wlserver6.1\lib\weblogic.jar;C:\SHADOW\JDBC\scjd12.jar;C:\orant\jdbc\lib\classes111.zip
rem *** Set Command Line for service to execute
rem *** %JAVA_HOME%\java will automatically be prepended.
set CMDLINE=" -ms16m -mx16m -classpath \"%CLASSPATH%\" \"-Dbea.home=C:\p\bea\"
\"-Djava.security.policy==C:\p\bea\wlserver6.1/lib/weblogic.policy\" \"-Dweblogic.nodemanager.weblogicHome=C:\p\bea\wlserver6.1\"
\"-Dweblogic.nodemanager.reverseDNSenabled=true\" \"-Djava.library.path=c:\p\bea\wlserver6.1\bin\"
\"-Dweblogic.nodemanager.listenAddress=111.111.111.123\" \"-Dweblogic.nodemanager.trustedHosts=./config/nodemanager.hosts\"
weblogic.nodemanager.NodeManager"
rem *** Install the service
"C:\p\bea\wlserver6.1\bin\beasvc" -install -svcname:EDANodeManager -javahome:"C:\p\bea\jdk131"
-execdir:"C:\p\bea\wlserver6.1" -extrapath:"C:\p\bea\wlserver6.1\bin" -cmdline:%CMDLINE%
ENDLOCAL
================= END installNMNtService.cmd ==================
But when I start a server remotely, it can't find the native libraries and it
can't find the JDBC libraries in the CLASSPATH. Otherwise, it can serve up HTML
pages at the correct port number so I know it's running.
When starting a managed server remotely via the WLS 6.1 console, how do I tell
the managed server where the native libraries and JDBC libraries are?
Thanks!Hi,
The memory setting on the WC_Spaces managed servers can be seen as mentioned below.
ps -eaf | grep Spaces
Above command shows something like this at the top of the output:
/a01/app/oraweb/middle/jrrt-3.1.2-1.6.0/bin/java -jrockit -Xms512m -Xmx1024m -Dweblogic.Name=WC_Spaces1 ...
Regards
Sreedhar -
Invalid directory path for windows...?
DECLARE
v_file UTL_FILE.FILE_TYPE;
v_dir VARCHAR2(250);
v_filename VARCHAR2(50);
BEGIN
v_dir := 'D:/LANDMARK/datamigration';
v_filename := 'pc_datamigration_out';
v_file := UTL_FILE.FOPEN(v_dir, v_filename, 'w');
UTL_FILE.PUT_LINE(v_file, 'Test file for usage of UTL_FILE package');
UTL_FILE.FCLOSE(v_file);
exception
when others then
dbms_output.put_line('Err utl file..!'||sqlerrm);
END;
I am getting eror "Err utl file..!ORA-29280: invalid directory path"
kindly help me to fix problem.I am working on windows machine not on unix.
rgds,
pcThe correct thing to do is to create a directory object e.g.:
CREATE OR REPLACE DIRECTORY mydir AS 'c:\myfiles';Note: This does not create the directory on the file system. You have to do that yourself and ensure that oracle has permission to read/write to that file system directory.
Then, grant permission to the users who require access e.g....
GRANT READ,WRITE ON DIRECTORY mydir TO myuser;Then use that directory object inside your FOPEN statement e.g.
fh := UTL_FILE.FOPEN('MYDIR', 'myfile.txt', 'r');Note: You MUST specify the directory object name in quotes and in UPPER case for this to work as it is a string that is referring to a database object name which will have been stored in uppercase by default.
p.s. as already mentioned by others, this directory must be on your Oracle database server. You can only access client directories if the server itself has a mapping to the client machine itself. Don't expect to provide a path and for the process to access the local client machine of whoever uses it.
Edited by: BluShadow on 24-Nov-2010 12:24 -
Hi All,
I am trying to set the classpath in a MAC OS and not able to get through. Can anyone tell me how to do it or at least any links to proper documentation?
Also I have few class files and it is working fine in Windows OS. Do I have to recompile separately for MAC OS?
I think we don�t have to compile separately for each OS. The reason I am asking this question for some reason I am not able to use in Mac OS.
Thanks for all your helps.I am trying to set the classpath in a MAC OS and not able to get through. Can anyone tell me >how to do it or at least any links to proper documentation?I haven't compiled any code using MAC OS X. but i took my jar file of the application i made & ran it.It ran OK( actually better) without any change.
Also I have few class files and it is working fine in Windows OS. Do I have to recompile separately >for MAC OS?
I think we don�t have to compile separately for each OS. The reason I am asking this question for >some reason I am not able to use in Mac OS.No, you don't have to. but you must make sure that the directory structure is same if you have a package. i'm talking about MAC OS X only. -
Registry Keys path for Windows 2008 (64-bit)
In the BusinessObjects Enterprise Administrator's Guide it discusses setting the range of ports that the RAS uses in the following registry keys in Windows as.....
HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\CER\RequestPortLower
HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\CER\RequestPortUpper
That only applies to 32-bit OS. If you are running under 64-bit OS then the paths are different....
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\CER\RequestPortLower
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\CER\RequestPortUpper
Posting this here so others can find it.Ingo -
This is for the BusinessObjects BI Solution Architecture, the REGEDIT path documented in the "working with firewalls" section of the BOE-3.1 Admin Guide applies only to the 32 bit version of Windows.
In the 64-bit OS, the path is different....as noted in my post.
Looking forward to taking your BOE-4.0 course in Orlando on Sunday.
Thanks,
Mark -
Accounting for Multiple Cygwin Paths for Windows Hosts
Hello everyone,
We are using EM12cR2 (installed on RHEL) but need to monitor a number of Windows hosts. For most Windows hosts, Cygwin is installed in the default path (C:\cygwin) but we also have Citrix XenApp servers that we would like to monitor but they do not have a C: drive, just M:. I've seen the settings file that allows someone to change the Cygwin path but I can't find information on whether or not you can add multiple paths to that line and what that syntax would be. I've also seen an older Citrix plug-in but I don't see anything stating it's compatibility with this version of EM. If I could, I would test out a number of scenarios in a lab environment but we don't have that option.
Does anyone know if it's possible to add multiple Cygwin paths (and what the syntax is), if the Citrix plug-in is compatible with EM12cR2, or if there's another way to do this that I'm not thinking of?
Thank you,
EMSHi ,
you have to update the following properties in $OMS_HOME/oui/prov/ssPaths_msplats.properties to reflect the new cygwin installation location.
eg.
From
SSH_PATH=C:/cygwin/bin/ssh.exe
SCP_PATH=C:/cygwin/bin/scp.exe
MKDIR_PATH=C:/cygwin/bin/mkdir.exe
SH_PATH=C:/cygwin/bin/sh.exe
CHMOD_PATH=C:/cygwin/bin/chmod.exe
TRUE=C:/cygwin/bin/true.exe
To
SSH_PATH=M:/cygwin/bin/ssh.exe
SCP_PATH=M:/cygwin/bin/scp.exe
MKDIR_PATH=M:/cygwin/bin/mkdir.exe
SH_PATH=M:/cygwin/bin/sh.exe
CHMOD_PATH=M:/cygwin/bin/chmod.exe
TRUE=M:/cygwin/bin/true.exe
thanks,
Prakash -
Physical Path in File Adapter for Windows Server
Hi There,
I am trying to read a file from a directory on a windows server and write it to the same server in a different directory.
In the file adapter I gave the value for physical path as below:
"\\10.xx.34.xxx\Share\input".
However I am getting below message in the debug:
"Value specified for input Physical/Logical Directory is not a directory or is not readable."
Hence my question is what should be the value in the physical path for windows server.
Thanks in Advance
Krishna
Edited by: user452458 on Jul 19, 2010 11:30 AMThanks for your reply again.
Actually they are not on the same file system.
I have successfully used FTP Adapter to connect to a UNIX server.
However is it possible to use FTP Adapter for Windows Server. If so how should be the corresponding JNDI defined.
I am getting below error when I use FTP Adapter for Windows Server:
Unable to send file to server. [Caused by: A remote host refused an attempted connect operation.]
; nested exception is:
ORABPEL-11429
Error sending file to FTP Server.
Unable to send file to server. [Caused by: A remote host refused an attempted connect operation.]
Please ensure 1. Specified remote output Dir has write permission 2. Output filename has not exceeded the max chararters allowed by the OS and 3. Remote File System has enough space.
Please Advise.
Thanks
Krishna -
Multiple Class-Path: attributes in Jar files
Hello,
I'm packaging a set of jar files for distribution with Class-Path: attributes in them. In the documentation I read and in one of the java trails it said that I could have a manifest file like:
Class-Path: log4j.jar log4j-core.jar
Class-Path: jsse.jar jcert.jar jnet.jar
But this doesn't work. It only works when I do this:
Class-Path: log4j.jar log4j-core.jar jsse.jar jcert.jar jnet.jar
Here is how I'm running the jar:
java -jar server.jar
Is the documentation wrong? Or this is a bug?
thanks
charlieCertain attributes were only meant to be specified once. Like Main-Class and Class-Path for example. If these were listed two or more times, then the last occurance is the one that gets recognized (basically, each new instance overwrites the previous instance). Some attributes are listed as "per-entry" and are freely duplicated for each entry. For example signed jars could have a number of Name: and xxx-Digest: attributes.
This link is to the manifest spec:
http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html
To answer the original posters question, the doc's are in error. Actually, the error was not in the docs, it was in the tutorial, but none the less its still in error. He could have done this:
Class-Path: log4j.jar log4j-core.jar
jsse.jar jcert.jar jnet.jar
^-- two spaces before the start of jsse.jar
because the docs allow for line continuation (although it's not exactly clear if you read the docs). The docs are also apparently in error regarding the max line length of 72 bytes. I have tested this with over 100 char's on a win32 machine and it works fine for me. The limitation must therefore apply to some other operating system, or it could just be in error.
-Ron -
Hi
I am new to solaris environment. I have a java file which is dependent on xerces.jar. to compile the file i need to set the classpath. pleas let me know how to set class path for xerces.jar which is in usr/raj/ folder structure of solaris machine.
if there is any on the fly method of setting classpath plz let me know....
thanks a lot
rajWhat shell are you using?
csh: setenv CLASSPATH ${CLASSPATH}:/usr/raj/xerces.jarsh/ksh: CLASSPATH=${CLASSPATH}:/usr/raj/xerces.jar
export CLASSPATH
Maybe you are looking for
-
Please help me to resolve this issue. I am getting the Error in invoking target 'ntcontab.o' while upgrading the oracle database 10.2.0.1 to 10.2.0.4 Exception Name: MakefileException Exception String: Error in invoking target 'ntcontab.o' of makefil
-
Lost mouse connection. Replaced batteries but still no recognition. Advice?
I had a message saying 'Lost connection' with mouse icon. I replaced batteries but still no recognition. Advice?
-
Hi all i have the following types: <begin of type1, fieldA type i , fieldB type i, <end of type1, <begin of type2, fieldC type i fieldA type i, <end of type2, <begin of type3, fieldA type i, fieldB type i, fieldC type i, <end of type3, <begin of type
-
Apple mail sender name different than sender only on my mail
When I receive an email from my husband, the name in the in box is not his, even though when i open the email his name and address are correct.
-
Loaded $25 tunes card to iMac a while back. Couldn't find where it was on the system. Plugged my synced iPod into a new car's USB and learned that many new songs that I did not select play on the car stereo. Have no idea how they got selected, but Ap