Javac exception in thread "main"

Problem javac exception in thread "main" NoClassDefFoundError: com\sun\tools\javac\ [off screen]
etc etc
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.util.Options
etc etc
Background 2006 java worked fine (with JEdit) on intro SUN course on this machine. I came back recently , upgraded to latest version and now javac gives above error in response to anything. I have done a little java before (diploma Open University)
Platform Dell dimension 4550 2.5MHz 512Mb RAM WinXP professional + SP2 + all auto updates
What have I done?
1 searched forums and not found this identical error discussed
2 reloaded Java (more than once) and searched for other versions on disc (not now present)
3 Looked at the usual suspects
PATH,(C:\Program Files\Java\jdk1.6.0_07\bin\;C:\Program Files\Java\jdk1.6.0_07\bin; c:\Program Files\Java\jdk1.6.0_07\lib\tools.jar;c:\FPD26) [for legacy FoxPro2.6a]
CLASSPATH, (blank or .)
JAVA_HOME (c:\Program Files\Java\jdk1.6.0_07\bin)
but found no solution
Siituation I am stuck, not knowing how to diagnose the problem - my hardware? my configuration? combination of the 2? And how to find out? The error msg outlined above occurs with even
c:\javac HelloWorld.java or just c:\javac - version
whereas c:\java - version gets "c:\jdk1.6.0_07".
Assistance would be much appreciated: it is unpleasant to be at the mercy of a computer.

If you were using a real OS I'd suggest trying "which javac"Too easy... For windows...
Add C:\Java\scripts to your PATH (MyComputer~Properties~Advanced~Environment Variables)
C:\Java\scripts\which.bat
@echo off
java -cp "c:\java\home\classes" tools.Which %*
C:\java\home\src\tools\Which.java
package tools;
import java.io.File;
class Which
  private static final String[] extensions = new String[] { ".bat", ".com", ".exe" };
  public static void main(String... args) {
    for( String filename : args ) {
      for( String path : System.getenv("PATH").split(System.getProperty("path.separator")) ) {
        for( String ext : extensions ) {
          String canonical = path+File.separatorChar+filename+ext;
          if ( new File(canonical).exists() ) {
            System.out.println(canonical);
Compile & Run with:
C:\Users\Administrator> cd /d c:\java\home\src\tools
C:\Java\home\src\tools> javac -d C:\java\home\classes Which.java
C:\Java\home\src\tools> which javac
C:\Java\jdk\jdk1.6.0_04\bin\javac.exe

Similar Messages

  • How to solve this problem"exception in thread "main" java.lang.noclassdeff"

    I am a tyro of java programming .
    i downloaded the j2sdk-1_4_2_09-windows-i586-p.exe from www.java.sun.com and installed it at the defaulted path C:\j2sdk1.4.2_09,
    then i wrote down my first java program as follow:
    public class hello
    public static void main (String args[])
    System.out.println("hello,����!");
    }and stored it at C:\Javasmp\ch01\hello.java.
    after that i opened dos commind window and compiled it :
    c:\javac C:\Javasmp\ch01\hello.java. and obtained file hello.class (C:\Javasmp\ch01\hello.class)
    but when running it (c:\java C:\Javasmp\ch01\hello) there was a mistake:
    exception in thread "main"java.lang.noclassdeffounderror:C:\Javasmp\ch01\hello
    i searched on the internet and found out the solution is set enviroment viriable ,so i set the "CLASSPATH" as".;C:\j2sdk1.4.2_09\lib;C:\j2sdk1.4.2_09\lib\tools.jar" ,"PATH" as"C:\j2sdk1.4.2_09\bin;C:\Windows\system32;c:\windows\system32\Wbem" and "JAVA_HOME" as "C:\j2sdk1.4.2_09\bin;C:\j2sdk1.4.2_09\jre\bin"
    afer that, i opened a new dos command window and run it again ,but the problem was still unsolved.
    in addition,my os is "windows xp"
    anyone can help me ,thank you!
    i am a student in China,it's a hard time for me to write down my question in english ,i doubt whether i express my question clearly.
    thank you for you reading.

    I have created a simple applet.
    import java.lang.*;
    import java.awt.*;
    public class jawtex3 extends java.applet.Applet
    public void init()
    add(new Button("One"));
    add(new Button("Two"));
    public Dimension preferredSize()
    return new Dimension(200, 100);
    public static void main(String [] args)
    Frame f = new Frame(" jawtex3");
    jawtex3 ex = new jawtex3();
    ex.init();
    f.add("Center", ex);
    f.pack();
    f.show();
    In this no compilation errors.
    I am getting runtime exception.as Exception in thread "main"java.lang.NoClassDefFound Error: jawtex
    reply me soon.
    thankyou.

  • Message Mapping : ( Not Activating )-Main Exception in thread "main"

    Hi all
          I have configured a message mapping , with proper occurence checked for
    both source & target MesTypes.
    But on activation it is throwing the error :
    <b>java.lang.NoClassDefFoundError: com/sun/tools/javac/Main Exception in thread "main"</b>
    Also my previous mappings are also not activating , which were running properly previously...
    i tried these option already :-
    --> i also restart the Java Stack...
    ---> Re: JAVA stack not starting
    > SAp note 928038
    still i am getting the same error..
    Regards
    Ashutosh Rawat

    Ashutosh,
    I am not sure weather it will resolve your problem but you can give a try to it.
    If you have the access for tcode "<b>SICF</b>" then
    1. Run tcode SICF, and press F8 button.
    2. default_host>sap>xi.
    3. Now check the below mentioned are activated (activated services will be in black) or not, if not then just right click and activate the service:
         i). adapter_plain
        ii). cache
       iii). cache_gui
        iv). cache_ssl
         v). docu_apperror
        vi). docu_syserror
       vii). engine
      viii). simulation
    Regards,
    Sarvesh
    Message was edited by:
            Sarvesh Singh
        <b>SFIC</b> is corrected to "<b>SICF</b>"

  • Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldSwing

    Hello;
    I got a error to run my application, i have not problem with compile it. But it give me the following error massage when i run it.
    Could anyone help me please.
    E:\Java>javac HelloWorldSwing.java
    E:\Java>java HelloWorldSwing
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldSwing
    E:\Java>path
    PATH=C:\Program Files\Java\jdk1.6.0\bin;C:\Program Files\QuickTime\QTSystem\;C:\
    Program Files\Common Files\Adobe\AGL;C:\Program Files\Microsoft SQL Server\80\To
    ols\BINN;C:\Program Files\Java\jre1.6.0\bin;C:\Program Files\Java\jre1.6.0\bin;C
    :\Program Files\Java\j2re1.4.2_13\bin
    The following are where my jdk and jre store.
    C:\Program Files\Java>dir
    Volume in drive C has no label.
    Volume Serial Number is 3023-229B
    Directory of C:\Program Files\Java
    04/02/2007 12:22 AM <DIR> .
    04/02/2007 12:22 AM <DIR> ..
    01/02/2007 10:54 PM <DIR> j2re1.4.2_13
    03/02/2007 04:54 PM <DIR> jdk1.6.0
    01/02/2007 10:02 PM <DIR> jre1.5.0_06
    04/02/2007 12:22 AM <DIR> jre1.6.0
    0 File(s) 0 bytes
    6 Dir(s) 5,761,228,800 bytes free

    It even tries to tell you what's wrong. Run class "start.HelloWorldSwing", not "HelloWorldSwing".
    I bet that copying that error message without the class name into Google would have given you the answer right away.

  • Exception in thread "main" - error: Please help

    I installed the Java 1.4.0 beta on my machine. I configured the JRE and the javac and java commands are responding well. Now I have written very simple classes which are compiling without errors. But now, if I use the java command to run the classes, I am getting the following message:
    Exception in thread "main" java.lang.NoClassFoundError: ForTick/class ;
    where ForTick is the name of my class for example. Where am I going wrong? Also, where do I find documentation for error messages like this - I have toured almost the whole java website and even the documentation that I downloaded -but I couldn't find it.
    Please help me coz I am just stuck.

    Did you try
    java ForTick.class ?
    If so, please try
    java ForTickHope this helps

  • Exception in thread main with package name

    I've got this problem: my program works fine when I haven't the line for the package name. When I put it, it compiles fine, but when executing it says "Exception in thread main" and a lot of other information from classes it can't find. I've got the '.' in my classpath, I've tried to move the directory to the root, and to execute it I do not use '.class'.
    Can anyone help me?

    This is a minimal explanation of packages.
    Assume that your programs are part of a package named myapp, which is specified by
    this first line in each source file: package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

  • Error after compile Exception in thread "main" java.lang.NoClassDefFoundErr

    Hi I am very new to Java programming, right now I am using a mac os 10.49
    I can create java documents using bbedit and then they compile when i type
    javac.
    But when i type java *.java I get the following error
    Exception in thread "main" java.lang.NoClassDefFoundError
    If I type java "filename"
    without the .java at the end of the file the terminal has no response
    I understand i am supposed to some how set the classpath but i do not know how to do this
    Also I can create and compile and then run my java in the eclipse program that i have installed, but not from terminal and im not sure why.
    Thanks for the help.

    I understand i am supposed to some how set the classpath but i do not know how
    to do thisThere is no need to set a system variable CLASSPATH, it is inflexible to do so, and it can lead to unpredictable behaviour.
    You should be able to compile and run programs from the command line, specifying the classpath as part of the commands you use.
    (1) For instance, you can create a file HelloWorld.java with the following contents:public class HelloWorld {
        public static void main(String args[]) {
            System.out.println("Hello world");
    }(2) From the command line (console) navigate to the folder (directory) containing this file and compile it with the commandjavac -cp . HelloWorld.javaThe "-cp ." part is what specifies the classpath. Note that it is a file that is being compiled so we specify the actual file name including the extension. At this point you should be able to check that the HelloWorld.class file has been created.
    (3) From the same folder (directory) you run the program withjava -cp . HelloWorldThe classpath is being specified in the same way as before. It is a class that is being invoked, so we don't specify a filename. (much less use wildcards like *).
    Documentation for the java and javac tools (and others) are linked to from this page: http://java.sun.com/javase/6/docs/index.html

  • ERROR: Exception in thread "main"

    i am running java runtime version 1.4.0_01 on a windows 95 computer
    here is the source im having a problem with:
    Project: Create a Java Program which will display your initials (minimum 2) in "block letters".
    Program Name: Initials1
    Mailbox: Initials
    public class Initials1
    public static void main(String[] args) // Method header
    System.out.println("\tDD \tBBBB \tPPPP "); //line 1
    System.out.println("\tD D \tB B\tP P"); //line 2
    System.out.println("\tD D \tBBBB \tP P"); //line 3
    System.out.println("\tD D\tBB \tPPPP "); //line 4
    System.out.println("\tD D\tB B \tP "); //line 5
    System.out.println("\tD D \tB B\tP "); //line 6
    System.out.println("\tDDD \tBBBB \tP "); //line 7
    }// public static void main
    } // class Initials1
    It compiles fine, but when i try to run it, i get this error:
    "Exception in thread "main" java.lang.NoClassDefFoundError: Initials1
    I set the classpath in dos:
    H:\>set CLASSPATH=
    H:\>set CLASSPATH=H:\
    compiled:
    H:\>path=c:\.......
    H:\>javac Initials1.java
    but it wont run correctly
    uh oh, thats the bell, btw, my teacher says forums=OK
    [lx out]

    javac Initials1.java
    java -cp Initials1

  • Exception in thread "main" java.sql.SQLException:

    when i run the JdbcTest.java program happen this:
    C:\temp>javac JdbcTest.java
    C:\temp>java -cp .;C:\oracle\ora81\jdbc\lib\classes111.zip JdbcTest
    Exception in thread "main" java.sql.SQLException: Eccezione IO: Connection refus
    ed(DESCRIPTION=(TMP=)(VSNNUM=135290880)(ERR=12500)(ERROR_STACK=(ERROR=(CODE=1250
    0)(EMFI=4))(ERROR=(CODE=12560)(EMFI=4))(ERROR=(CODE=530)(EMFI=4))(ERROR=(BUF='32
    -bit Windows Error: 2: No such file or directory'))))
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at JdbcTest.main(JdbcTest.java:12)
    the sample code is this>
    import java.sql.*;
    class JdbcTest {
    public static void main (String args []) throws SQLException {
    // Load Oracle driver
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    // Connect to the local database
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:thin:@pcserver:1521:PIRELLI",
    "vetture", "vetture");
    // Query the employee names
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("select a from pippo");
    // Print the name out
    while (rset.next ())
    System.out.println (rset.getString (1));
    -------please halp me

    what u say is correct becouse if i use another db-oracle
    and for use it i change the host, the port and sid, it works.
    DriverManager.getConnection ("jdbc:oracle:thin:@ULISSE:1651:APIS",
    "vetture", "vetture");
    and in this case the database is on another machine.
    if i try with :
    DriverManager.getConnection ("jdbc:oracle:thin:@pcserver:1521:PIRELLI",
    "vetture", "vetture");
    doesn't work, but i can read from the database with another product TOAD, so this meand the DB service is running, I can't undestand.
    In any case thanks becouse now i know that the problem is not about classpath or sqlstatement, but is only about configuration and service.

  • Help me solving this exception: Exception in thread "main" java.lang...

    Dear,
    I have "test" class:
    public class test{
    public static void main(String argv[]){
    System.out.println("Hello world!");
    I use below command to compiler & run this class:
    C:\> javac test.java
    There is no problem and I get file: test.class
    After that, I use:
    C:\> java test
    I meet this message and the class cannot be run:
    Exception in thread "main" java.lang.NoClassDefFoundError: test
    Please help me to solve this problem.
    Regards,
    Cuong Ha

    before running set classpath
    like this type in command prompt
    suppose this class file in in folder c:\abc
    set classpath=%classpath%;C:\abc\
    and now run ur code
    or
    i think this is better solution not try aboce try this first
    before running
    type this
    set path=%path%;c:\jdk1.3\bin
    where 'c:\jdk1.3\bin' is the path where ur jdk is installed

  • Exception in thread "main" java.lang.UnsupportedClassVersionError:

    when i run javac its works fine.when i run java.exe the problem occurs.my jre and other java package is a part of the file that i downloaded from sun.com. i tried to reinstall but i doesn`t help.
    Exception in thread "main" java.lang.UnsupportedClassVersionError: NullPointer (Unsupported major.min
    or version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    plz help..

    Hi,
    I had the same problem. I got the sam advice about the 'two versions' story.
    I was running java programs for Java 1.5 under Win ME (please don't laugh). I then I upgraded to XP. I re-installed Java 1.5. Suddenlu those same programs that were running under ME won't run under XP. Getting the same message as above.
    I only had 1 (one) Java version installed. That was Jave 1.5
    The funny thing is that jsp pages that I created under ME still worked fine under XP without me doing anything to them
    I un-installed Jave 1.5, re-install it and what do you know? Everything is fine now?
    It's a strange, strange world we program in, Master Jack (taken from a hit song in the late 60's in SA - need I say more?)
    Phlip

  • Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/pool

    I have the following configuration:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    on a Suse 10.1 Linux.
    The javaversion is Java.Version = 1.4.2_11
    The classpath does look like:
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen> echo $CLASSPATH
    /derby.jar:/derbytools.jar:/derbynet.jar:/derbyclient.jar:/derbyTesting.jar:/local/derby/tools/java/jakarta-oro-2.0.8.jar:/derbyLocale_de_DE.jar:/derbyLocale_es.jar:/derbyLocale_fr.jar:/derbyLocale_it.jar:/derbyLocale_ja_JP.jar:/derbyLocale_ko_KR.jar:/derbyLocale_pt_BR.jar:/derbyLocale_zh_CN.jar:/derbyLocale_zh_TW.jar:/oracle/oracle/product/10.2.0/db_1/jdbc/lib/classes12.jar:/oracle/oracle/product/10.2.0/db_1/jdbc/lib/classes12.zip:/oracle/oracle/product/10.2.0/db_1/jlib/orai18n.jar:/oracle/oracle/product/10.2.0/db_1/jdbc/lib/ojdbc14.jar:/home/Eisele/Oracle/ojdbc14.jar:/home/Eisele/FH-Weihenstephan/Winter_Semester_200809/Uebungen
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen>
    The Program JDBCVersion.java which I copied out of the Oracle-Documentation looks like:
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.OracleDataSource;
    class JDBCVersion
    public static void main (String args[]) throws SQLException
    System.out.println("Java.Version = " + System.getProperty("java.version")) ;
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("jdbc:oracle:thin:scott/tiger@host:port:service");
    Connection conn = ods.getConnection();
    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData();
    // gets driver info:
    System.out.println("JDBC driver version is " + meta.getDriverVersion());
    I get the following error
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen> javac JDBCVersion.java
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen> java -cp ~/FH-Weihenstephan/Winter_Semester_200809/Uebungen/ JDBCVersion
    Java.Version = 1.4.2_11
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource
    at JDBCVersion.main(JDBCVersion.java:10)
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen>
    Can anyone help me out here and tell me, what I did wrong ?
    Thanks in advance !
    Rüdiger

    Two thoughts.
    The first is that 10.2.0.1 is unpatched. Why? It has been two years since its release and no one has applied 10.2.0.2, 10.2.0.3 or 10.2.0.4.
    The second is that your question is not a database question but a Java question is you are more likely to get an answer that will help you if you post in a group where it is on-topic.

  • Exception in thread "main" related to CLASSPATH and unable to load driver??

    Hi,
    I am a JAVA beginner, I have met some problems cannot solve, can somebody help?
    My OS is Windows2000
    Java SDK in C:\j2sdk-1_4_2_04 and Java JRE in C:\Program Files\Java\j2re1.4.2_04 [Installation: j2sdk-1_4_2_04-windows-i586-p.exe]
    MySQL in C:\mysql [Installation: mysql-4.0.18-win.zip]
    MyODBC in C:\Download\MYODBC [Installation: MyODBC-3.51.06.exe]
    MyJDBC in C:\mysql-connector-java-3.0.11-stable [Installation: mysql-connector-java-3.0.11-stable.zip]
    Enviornment Variables Settings
    PATH = C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\j2sdk1.4.2_04\bin;C:\mysql\bin
    JAVA_HOME = C:\j2sdk1.4.2_04
    (CASE ONE) - While I didn't set a new Enviornment Variable for CLASSPATH
    HelloWorld.class can work properly and LoadDriver.class cannot work due to Unable to load Driver (As below)
    C:\JavaTry>javac HelloWorld.java
    C:\JavaTry>java HelloWorld
    Hello World!
    C:\JavaTry>javac LoadDriver.java
    C:\JavaTry>java LoadDriver
    Unable to load driver.
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at LoadDriver.main(LoadDriver.java:7)
    (CASE TWO) - While I set a new Enviornment Variable for CLASSPATH (No matter which settings as below)
    CLASSPATH = C:\mysql-connector-java-3.0.11-stable\mysql-connector-java-3.0.11-stable-bin.jar
    CLASSPATH = C:\mysql-connector-java-3.0.11-stable
    CLASSPATH = C:\mysql-connector-java-3.0.11-stable\com;C:\mysql-connector-java-3.0.11-stable\org
    Both the HelloWorld.class and LoadDriver cannot work properly due to Exception in thread "main" java.lang.NoClassDefFoundError (As below)
    C:\JavaTry>javac HelloWorld.java
    C:\JavaTry>java HelloWorld
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
    C:\JavaTry>javac LoadDriver.java
    C:\JavaTry>java LoadDriver
    Exception in thread "main" java.lang.NoClassDefFoundError: LoadDriver
    Below are the JAVA scripts which I used
    -> HelloWorld.java
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World!");
    -> LoadDriver.java
    import java.sql.*;
    public class LoadDriver {
    public static void main(String[] Args) {
    try {
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    /* Class.forName("com.mysql.jdbc.Driver").newInstance(); <- either one try the same */
    } catch (Exception E) {
    System.err.println("Unable to load driver.");
    E.printStackTrace();
    Moreover, I saw some information only standalone application need to set CLASSPATH, right??

    My problem "unable to load driver" have solved.
    I set the CLASSPATH = C:\mysql-connector-java-3.0.11-stable\mysql-connector-java-3.0.11-stable-bin.jar
    and try
    java -cp ".";%CLASSPATH% LoadDriver
    Thanks masnare again :> and who provided the link http://www.kevinboone.com/classpath.html in the forums others similar topics, actually I forgot which topic and who, so... :P no matter whom thanks very much :)

  • Exception in thread "main" error

    I have a real problem. I am trying to write a hello world program in java using native code. my java code is as follow :
    class HelloWorld {
    static {
    System.loadLibrary("Hello.so");
    private native void print();
    public static void main(String[] args) {
    new HelloWorld().print();
    System.out.println("Good bye Hello World!!");
    my native c code is as follow :
    #include <jni.h>
    #include <stdio.h>
    #include "HelloWorld.h"
    JNIEXPORT void JNICALL
    print(JNIEnv *env,jobject obj) {
    printf("Hello cruel world. Hope you can live through the Human Phase!.\n");
    return ;
    I use javac HelloWorld.java to get my HelloWorld.class file.
    I use javah HelloWorld to het my HelloWorld.h file
    i set my LD_LOBRARY_PATH to where my native code is.
    i compile the c code using "
    gcc -c -I /usr/java/j2sdk1.4.0/include -I /usr/java/j2sdk1.4.0/include/linux HelloWorld.c -o Hello.so
    everything is good up to this point. But when i call java HelloWorld, i get the following error : "
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no Hello.so in java.library.path     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1370)
         at java.lang.Runtime.loadLibrary0(Runtime.java:773)
         at java.lang.System.loadLibrary(System.java:835)
         at HelloWorld.<clinit>(HelloWorld.java:3)
    Can any one help. I am using RedHat 7.2, kernel 2.4.10-17.
    Thank you
    Shafi Jourabchi [email protected]

    Thank you all who have responded. The solution to my problem was with the compile options. I was not using the right option to compile the shared lib object file.
    the command i used ( and it worked ) was :
    gcc -o libHello.so -shared -Wl, -soname,libHello.so -I /usr/java/j2sdk/include -I /usr/java/j2sdk/include/linux HelloWorldImp.c -static -Lc
    Shafi jourabchi

  • Exception in thread "main" java.lang.NoClassDefFoundError: SayHi/class

    Program - c:\jdk1.3.1_01\demo\SayHi.java
    import java.io.*;
    class SayHi
    public static void main(String[] args)
    System.out.println("hellow Worls");
    Operating Environment-
    1) New installation of Windows Advance 2000 Server. No other installatons.
    2) Installed j2sdk-1_3_1_01a-win.exe which I downloaded today.
    3) Modified path - PATH=c:\jdk1.3.1_01\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
    4 Created the above program in c:\jdk1.3.1\demo
    4a) javac SayHi.java
    4b) java SayHi.class
    ERROR MESSAGE ENCOUNTERED
    Exception in thread "main" java.lang.NoClassDefFoundError: SayHi/class
    5) I've experimented with the -classpath
    6) I've followed the installation notes for Version 1.3.1
    and searched the support site and found numerious problems in this area.
    7) I've encountered this same problem on Windows 2K Professional.
    I need some help getting the tools to work

    Try running the sample by typing:
    java SayHi
    I hope you're using a book or taking a course to learn Java. Pay attention to the details.

Maybe you are looking for

  • Pricing amount and condition value in sales order

    Hi all, I have noticed for a sales order we are not able to see condition type amount, condition value in sales order even though it shows net price finaly ofr a sales order. Not even able to select the condition lines. To be specific not able to fin

  • How to create a clock with: a reset, start and stop

    How can i create a clock that have to do the following thing: Countdown visual in the screen Timeset with day's in seconds - Pressing start -> it start to run - Pressing stop -> The clock is stopping but it keeps the time, when i press start again th

  • Can't Delete First Page

    Have a 400-page document in Pages and need to delete the blank page at the beginning, but it won't let me!  I have "show invisibles" displayed but nothing is on that page.  I have tried deleting it by viewing the thumbnails but that is wanting to del

  • DVD button loop point

    I know this question is on here alot and I've already read some different things. I have a project where the DVD menu has and intro and at about 16 secs. the buttons fade in. I have figured out how to make the button delay by setting the loop point.

  • HT1926 When I click on the iTunes icon or iTunes from programs I get this: the item 'itunes.exe that this short cut refers to has been changed or moved.

    When I click on the iTunes icon or iTunes from programs I get this: the item 'itunes.exe that this short cut refers to has been changed or moved. So this short cut will no longer work.