473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

loading classes from jars

kw
A newbee question:
I have an application (Calc.class etc) it's a calculator, that uses
jep212.jar ("Java Mathematical Expression Parser" from
http://www.singularsys.com/jep/)
WinXP, path is : %path%;C:\j2sdk1.4.0._01\bin;. (as it should be)

And now from the command-line(dos) or a batch file:
java Calc
(apllication Calc works, but jep212 doesn't "load" : NoClassDefFoundError
org/funk/jep/JEP)

another try:
java -cp %path%;jep212.jar;. Calc
YES! works perfectly!

I put my own classes in a jar (Calc.jar) with MANIFEST.MF) , and
java -cp %path%;jep212.jar;. -jar Calc.jar
NoClassDefFoundError
when i use JDKCommander (http://www.geocities.com/jdkcommander/)(excellent
stuff!) I never have problems, even whitout a classpath specified.

When I put jep212 in C:\j2sdk1.4.0._01\jre\lib\ext (as it should be)

java Calc >>>NoClassDefFoundError
java Calc -cp %path%;C:\j2sdk1.4.0._01\jre\lib\ext\jep212.jarNoClassDefFoundError


Why do I have these ">>>NoClassDefFoundError" in the first place, since the
jep212.jar are inC:\j2sdk1.4.0._01\jre\lib\ext or even in the working
directory, and my own classes are always found. My other applications (for
instance database-appl that must loads drivers) show the same problems.
Don't understand it anymore!

Sorry to bother all of you;

Kowey

ko***@hotmail.com



Jul 17 '05 #1
1 2334
kw wrote:
another try:
java -cp %path%;jep212.jar;. Calc
YES! works perfectly!


It seems the vm doesn't care about your $CLASSPATH nor your -cp option when
the -jar option is used. Using 'java -jar ...' wipes out all other
classpath information, so that the jar file's Class-Path attribute is the
only classpath that's considered. I suppose this has something to do with
security, but I can't suggest a workaround. Anybody?

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Murat Tasan | last post by:
hi, i'm having a very odd problem... here is my system: debian linux java: j2sdk 1.4.1_02 everything is running fine, except for one little problem... i have a custom manifest file called...
1
by: Henri Sivonen | last post by:
I am trying to set up the Red Robin Jython Development Tools for Eclipse. It finds the Python libraries of Jython and my own jars. It does not find the JDK classes. If I try to add classes.jar from...
0
by: Cindy Lee | last post by:
When trying to load a .jar file with the command loadjava -v -u username/password -r .jar I get a bunch of errors like
1
by: Cindy Lee | last post by:
I need to insert rows into MySql database from oracle, which I imagine is a rather common task. The path I decided to take is write a java procedure, as recommended in the manual. However, java...
2
by: Rob | last post by:
I was working on a project and everything was going fine, then all of a sudden the form set as my startup object stopped loading. I tried setting some others as the startup object, and some of my...
5
by: Thomas | last post by:
Hi folks, is there any obvious reason why the java compiler cannot load jars from an NTFS filesystem under Linux (Debian) ? I know for sure that the path I specify is correct and I have read...
2
by: ksrashmi | last post by:
Hi , does jar file loaidng will consume the jvm memory ? I have to run the cronjobs for some of the java files . so i have writen the .sh file ( linux server) ...
2
by: nelsonbrodyk | last post by:
Hey All, I posted something similar in the .NET forums, but am unsure where it belongs, so forgive me if this is the wrong place. I have a client application, and a folder containing dll's that...
0
by: ndedhia1 | last post by:
I am having trouble loading a property file and keep getting this error when running my shell script that loads and runs my jar files, etc: no property file loaded, using defaults......
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.