Problem in compiling in Netbeans IDE

Hi all,
I am using Netbean 3.6. I am getting an error in compling
Class.forName("ClassName");
Cannot resolve symbol. What should I do About it.
However I am able compile the same program in command line. Only I am unable compile in netbean 3.6. Do I need to change any settings. Please let me know.
My mail Id is
[email protected]
[email protected]
Regards,
Saravanakumar

Is there any reason that you are using 3.6? I am using 5.5.
anyway the forName method returns the Class object associated with the class or interface with the given string name.
so for the given:
Class.forName("ClassName");
The Class.forName method must be used with care in JRE code. A call
of the type Class.forName(classname) can only be assumes to find classes on the bootclasspath, since it does a look up on the callers classloader

Similar Messages

  • Missing ant package while compiling in NetBeans IDE

    hi all,
    I am having problem compiling in NetBeans IDE 5.0. The error is package org.apache.tools.ant not found. I have installed apache-ant-1.6.5-bin and jdk1.5.0_07. Are these enough? The library files are in jar format. How can I tell if I having missing package "org.apache.tools.ant "?
    I am new to ANT tools and NetBeans. Can someone help?
    Thanks.

    i have tried with other projects and no problem. Only this project.
    What classes do I need to add into the project?

  • I have problems with WS in NetBeans IDE

    HI ALL!
    Duiring the compilation of web application including webServise i have a problem.
    Illustrated:
    wscompile-init:
    D:\projects\tests\test\nbproject\build-impl.xml:226: taskdef class com.sun.xml.rpc.tools.ant.Wscompile cannot be found
    BUILD FAILED (total time: 0 seconds)And the string of file build.xml
    <target name="wscompile-init" depends="init">
            <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile" classpath="${wscompile.classpath}"/>
            <taskdef name="wsclientuptodate" classname="org.netbeans.modules.websvc.core.ant.WsClientUpToDate" classpath="${wsclientuptodate.classpath}"/>
    I have the NetBeans IDE 4.1 and JDK 1.5.0_5.
    Help me, please!

    I have similar problem with NetBeans 5.0 beta when I tried to create a simple web service.
    From the Project View, under the hierarchy
    ---- Libraries
    right click and Add Libraries
    add the JAX-RPC 1.6 (which netbeans point to "c:\netbeans-5.0beta\ide6\modules\ext\jaxrpc16\*.jar"
    Press Ctrl+2 or Window|File to go to File View,
    open the file under the hierarchy
    --- nbproject
    +- project.properties
    originally it was
    javac.classpath=\
    ${libs.jaxrpc16.classpath}
    wscompile.classpath=${wscompile.tools.classpath}:${j2ee.platform.wscompile.classpath}
    I changed it to
    wscompile.classpath=${wscompile.tools.classpath}:${j2ee.platform.wscompile.classpath}:${libs.jaxrpc16.classpath}

  • Please Help.  NetBeans IDE Problem + rt.jar.  Trouble compiling MIDlets.

    Hi all. For the past few weeks I have undertaken learning Java for mobile devices. I am having a slight problem with NetBeans 5.5 which I would appreciate help in fixing.
    Currently installed on my system:-
    - Wireless Toolkit 2.5
    - NetBeans IDE 5.5 + Mobility Pack
    - j2sdk1.4.2_13
    - jdk1.6.0
    - jre1.6.0
    - javaee sdk5_02
    (So pretty much every Java application!)
    Now the problem. Basically, if I import the following at the beginning for my MIDlet...
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;... the java.sql has red line underneath saying "package does not exist". Now, what I found is that I need to import .jar files into the Library section. I managed to fix the javax.servlet package and some others, by importing the correct .jar files, but I found that to remove the red line for java.sql I need rt.jar.
    However, this is located under one of my jre folders and not the j2me / jdk folders I have. Even though it removes the red line, when I compile the project I keep receiving "PREVERIFY" errors and "CONSTANT POOL" errors.
    Yet, if I remove the rt.jar file, these go away, but it won't compile then because it says the package is missing (back to square one!).
    So, any ideas please??? I have spent days and days just adding random .jar files to try and fix the problem but to no avail. An example of current imported .jar files in NetBeans:-
    - rt.jar
    - midpapai.zip
    - jdbc.jar
    - servlet.jar
    - runtime12.jar
    - classes12.jar
    - ojdbc.jar
    Try not to be too technical, I've only just started out. Lol. Thanks in advance!!

    well... J2ME world is quite diffirent from usual Java. Actually you will not be able to use much of the staff, that you have imported, including java.io.* (it will be only available in CDC), java.servlet.*, java.servlet.http.*, java.sql.*
    So don't even try to find where are those packages are located....
    Try from simple tutorial like:
    http://developers.sun.com/techtopics/mobility/midp/articles/wtoolkit/
    Or from documentation on Netbeans.org:
    http://www.netbeans.org/kb/trails/mobility.html

  • I have a problem compiling servlets bymeans of NetBeans IDE 3.6.

    If I compile a servlet by means of another IDE, they are oK and work well with NetBeans too.
    On the contrary, if I compile it bymeans of Netbeans 3.6, I get a .class which does not work. I
    have realized also that for instance if the .class i get with the other IDE is 1,58 KB, if I use
    NetBeans I get a .class smaller, that is 1,53 Kb.
    Can you help me?
    Thanks
    Eugenia Mariani

    ok
    This is the servlet named Contatore.java
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Contatore extends HttpServlet
    private int conta;
    public void init(ServletConfig config) throws ServletException
    conta = 0;
    public void doGet(HttpServletRequest richiesta, HttpServletResponse risposta)
    throws IOException, ServletException
    conta++;
    risposta.setContentType("text/html");
    PrintWriter out = risposta.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Pagina con contatore</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("Questa pagina e' stata visualizzata");
    out.println("<h1>"+conta+ "</h1> volte.");
    out.println("</body>");
    out.println("</html>");
    out.close();
    Before using the compiler of NetBeans (that is after getting Contatore.class by means of Bluej) when I use Execute I see in Internet Explorer 6.0 with win Xp Pro at the
    http://localhost:8084/esempi/Contatore
    Questa pagina e' stata visualizzata
    1
    volte.
    and Contatore.class is 1,58 KB
    After that I use the compiler of NetBeans when I use Execute here the error from Tomcat 5.0
    I see in Internet Explorer 6.0 with win Xp Pro at the
    http://localhost:8084/esempi/Contatore
    HTTP Status 404 - Servlet Contatore is not available
    type Status report
    message Servlet Contatore is not available
    description The requested resource (Servlet Contatore is not available) is not available.
    Apache Tomcat/5.0.19
    and Contatore.class is 1,53 KB
    I hope to have said everything
    I wait a help, please.
    Thanks

  • Problem with netbeans IDE

    hey! i am a learner of j2se 5.0 and am horrible at command line compiling. so i use netbeans IDE and well it has been doing excellently till now.
    recently i had a porblem with ImageIcons and i found the exact problem which i was having but with repect to applets , that is, the images were not displaying properly. i have managed to solve the problem as far as applets are concerned, but it is not so with applications.
    the thing is when i use the run function of the IDE, it displays all icons perfectly and its as if nothing is wrong.
    it creates a .jar file which when i separately click to execute by going to its folder, does so but does not display any images. In fact it executes and behaves in such a way that it's exactly as if i have not used icons in the program- it displays everything else. should i change some setting of the IDE? but if some setting is to be changed, y is it running normally when run from the IDE( F6 key).
    also when i used the command line (after some research to learn to use it) to extract all files from the .jar file, all the images were in it!!!as well as all the class files. so i can't even say that the IDE has not bundled up the images into the .jar file.
    could some1 please help??i need help with .jar files and not applets.

    first i deefined a method as shown in the Java tutorial
    ImageIcon icon =createImageIcon("lion.jpg","name");
    ( within the contructor of the class)
    then after completing the constructor for the class- (I am trying to display an ImageIcon on the background of a JFrame)
    i provided the following definition after the constructor and b4 the main method:
    protected static ImageIcon createImageIcon(String path,
    String description) {
    java.net.URL imgURL = LabelDemo.class.getResource(path);
    if (imgURL != null) {
    return new ImageIcon(imgURL, description);
    } else {
    System.err.println("Couldn't find file: " + path);
    return null;
    this is what i did-and when run from the IDE-it is perfect, but the jar file ggenerated when executed displays every single thing-all swing components e.t.c EXCEPT the image
    the image is in the same folder as the source file- i checked because if not, an error is indicated- so that is not the problem here.
    this same exact code works perfectly with applets and they execute perfectly both from the IDE and also when executed separately.
    the same problem also iccurs when trying to display on labels and buttons.(only for JFrames not for JApplets)
    the thing is in the java tutorial the method is given for applets and so my applets worked -so is there somethin i'm missing for frames- as far as i know they r very similar as far as usage is concerned.

  • Problem with NetBeans IDE 5

    Hi All,
    I' m using NetBeans IDE 5 . Present my IDE works fine with J2SE. I would like to work with Servlets. There is an error while using servlet classes.
    Is this Installing problem ? or
    am i add servlet.jar for NetBeans IDE 5?
    Plase any one help me..................

    Right click on the library tab under your project in the projects window and click "add library". Servlet should be on the list.
    If not, check your installed modules and make sure servlet support is included.

  • Problem with NetBeans IDE 5.0

    sir i am using NetBeans IDE 5.0 and i am devoloping a swing appliaction.i had a jar file for an extra look and feel but i dont know where to place it .i even added jar file to java>> properties >> library
    but didnot work
    the devoloper has given look and feel jar and has given code for implemengting it

    hi
    Try this
    go to the project under which your java file is there and right click on the project and choose properties then under categories choose Libraries and after choosing that you will have to choose the Compile tab present on the right side and then click on Add JAR/Folder button and choose the jar file and then click ok.
    If you had done the above things and still not working then probably you would not have set the Main Class.To set the Main Class go to project under which your java file is there then right click and choose properties and then choose Run which is under categories and then after doing that on the right hand side you will find a number of things out of that Main Class will be present, in that relevant text box you should give the
    packagename.yourjavafilename(note: while giving the packagename.yourjavafilename in Main Class do not give .java extension for your javafilename ie. actually it is the class filename of your java file and it should also be noted that the java file name which you are giving in the Main Class should be your java file which contains the main method) then click on ok and now try to run the project then it should run properly.
    hope this helps you

  • Problem with Netbeans IDE 5.0: Building Gui

    Hello,
    I have the following problem with Netbeans IDE 5.0 (I made the same with netbeans 3.6 and it works properly):
    Step 1) Create a myJPanel class (new JPanel Form)
    Step 2) make a simple operation on myJPanel such as adding a JTable.
    Step 3) Create a myJForm Class (new JFrame Form)
    Step 4) Adding a JPanel to myJFrame (default name jPanel1)
    Step 5) Select JPanle1 within myJFrame and go to code-> custom creation code and write "new myJPanel();"
    this should set the jPanel1 (and all its contents and behaviours) created
    in step 4 equals to myJPanel();
    Step 6) run myJFrame;
    ........ and nothing happens. It is dispalyed just a gray JFrame.
    It seems that myJFrame is able to istantiate myJPanel() but is not able to paint it. what's wrong?
    Hope you may help me,
    thx

    Unfortunately, Netbeans 3.6 files and Netbeans 5 files are not compatible. Except the Java source files, Netbeans uses other aditional files such as xml files etc for forming GUI and other reasons. I have also faced the same problem with you. Good luck.

  • Problem in Connectivity to Derby Database in Netbeans IDE

    I am using the newest version of Netbeans IDE
    I already set the variable for JAVA_HOME and DERBY_HOME along with the path variables.
    I am trying to connect to Database in Network Mode
    using the following code
    try
    Class.forName("org.apache.derby.jdbc.ClientDriver");
    catch(ClassNotFoundException exception)
    exception.printStackTrace();
    but it is giving the runtime error that "Unable to load Driver"
    Please help me to get through this

    Try adding the following to your class:
    import org.apache.derby.jdbc.ClientDriver;
    If it produces an error, your driver *.jar file is not in the classpath.

  • Jsp netbeans ide problem

    at the time of execution, my netbeans ide(3.5) is not automatically starting the web browser. can anybody help me what settings i have to do to make the browser open automatically.thanks in advance.
    regards,
    srikanth

    It is
    tools
    options
    Server and External Tool Settings
    External Browser
    hope it helps

  • Swing application with JavaHelp crashes outside Netbeans IDE.

    Hi guys I have developed a small swing application in Netbeans IDE. I used the following code inside the IDE for JH.
    public void createHelp()
           try {
                   URL hsURL = new URL("jar:file:eDictionaryHelp.jar!/eDictionaryHelp/eDictionary.hs");
                   hs = new HelpSet(null, hsURL);
           catch (Exception ee)
            // Say what the exception really is
            System.out.println( "HelpSet " + ee.getMessage());
            System.out.println("HelpSet "+ helpHS +" not found");
            JOptionPane.showMessageDialog(new JFrame(), ee.getMessage(), "Error", ERROR_MESSAGE);
            hb = hs.createHelpBroker();
       }When I run the program inside the IDE and and click on the corresponding MenuItem.. JavaHelp comes up as it should! No problems with that.
    But when I build the project and tried to run it from the .jar file in the PROJECT_HOME/dist/ the swing got displayed till this function was called. and then it simply crashed.
    Investigating further and commenting out one line at a time and compiling I found out that whenever the hs = new HelpSet(null, hsURL); is encountered, the app crashes (it doesnt throw any error).
    But as I said this is not the case when i run and compile inside the IDE. I only get this problem when running the app from outside the IDE.
    I have tried all kinds of combinations of the URL .. for eg ( I am aware of Bug 4149782)
    ClassLoader cl = this.getClass().getClassLoader();
    try {
                   URL hsURL = HelpSet.findHelpSet(cl, helpHS);
    .What can be the problem guys? Any suggestions?
    Thanks!

    Anyone has an answer on this?
    I am facing the same problem.. I am using NetBeans 5.5
    arijit_datta, do u have a solution for this problem already?
    Thanks,
    SK

  • Preverification Error while using kXML with Netbeans IDE

    Hello All,
    I am using Netbeans IDE for wrting a program that parses a xml using
    kXML and display some results on screen.
    The Netbeans IDE gives the various obfuscation levels.
    The code is properly compiled at any level less than the
    highest obfuscation level. If I compile it at HIGH obfuscation level then it gives the following error-----
    Error preverifying class e
    VERIFIER ERROR e.a(Ll;)Lorg/kxml/kdom/Element;:
    Cannot find class org/kxml/kdom/Element
    D:\Netbeans_Workspace\TestObfuscation\nbproject\build-impl.xml:269: Preverification failed with error code 1.
    BUILD FAILED (total time: 4 seconds)
    How can we obfuscate the program using highest level of obfuscation.
    Thanks
    Vikas

    Thanks Peace,
    But I am facing the same problem even when I use the source java files of kXML and include those in my project and use them as additional classes to my class.
    It again builds properly when I don't use the highest obfuscation level.
    But if I try to obfuscate using Level HIGH it throws the same error.
    However when I try to run this project from J2ME Wireless Toolkit, it is running fine on the emulator.
    I guess the error is something specific to Netbeans IDE. Have anyone of you encountered such a bizzare error.
    Thanks,
    Vikas

  • Webservices usin java-netbeans ide

    Hi frnds
    Currently i am creating a webservice using java. I am using netbeans4.1 IDE. When i checked the example given in the quick start guide of Netbeans i am getting an error like cannnot find the Wscompil.class. Here iam pasting the build output
    init:
    deps-module-jar:
    deps-ear-jar:
    deps-jar:
    Created dir: C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\classes
    Created dir: C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\META-INF
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\META-INF
    library-inclusion-in-archive:
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\lib
    library-inclusion-in-manifest:
    Compiling 3 source files to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\classes
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web\WEB-INF\classes
    Copying 3 files to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web
    Copying 1 file to C:\Documents and Settings\sandeep.e\ws\HiWS\build\web
    wscompile-init:
    C:\Documents and Settings\sandeep.e\ws\HiWS\nbproject\build-impl.xml:226: taskdef class com.sun.xml.rpc.tools.ant.Wscompile cannot be found
    BUILD FAILED (total time: 10 seconds)
    Can anyone please telll me why this is happening? The jar files necessary is present in the library, eventhough it is showing the error.
    Thanks in anticipation

    This is a forum for matters concerning the Java programming language, not for the NetBeans IDE. Try to find a NetBeans forum for your NetBeans problems.
    I believe there's one on nabble.com and another on java-forums.org.
    db

  • Java 3D and NetBeans IDE 6.0.1

    Hi All
    I've installed Java3D after installing NetBeans 6.0.1.
    How would I integrate Java3D with the NetBeans IDE?
    I am trying to compile Java3D program I wrote a couple of years ago but it can't find the Java3D libraries.
    Any help would be appreciated in integrating Java3D with NetBeans. Java3D is installed correctly. I know this as I can execute Java3D executables but I can't build / compile programs in NetBeans.
    Thank you in advance.

    The NetBeans version 6.0.1 you are using is a old one.
    I dont know about that version
    I am using NetBeans 6.5 and I also had installed Java 3D after installing Netbeans IDE.
    I haven't done anything extra to integrate Java3D with NetBeans IDE.
    I don't know the cause of your problem but for sure for NetBeans 6.5 you don't need to do anything extra
    So I suggest may be you can upgrade your version of IDE and try once.

Maybe you are looking for

  • How to add an Observer to kLinksPanelWidgetID

    Hi, I dont know how to add an observer to kLinksPanelWidgetID. I tried kDocBoss and kTextStoryBoss but it is not enough. And if I try kWorkspaceBoss, when can I attach my observer ? Do you have an idea. Best Regards, Badr NASSER

  • How to import a XFDF file into a PDF?

    I need to import a XFDF file into a PDF through javascript. Manually in Acrobat 8.0 we are doing through the following steps. Comments->import comments->browser window open(select the corresponding xfdf file and then click select button)->After that

  • PPro 5.0.2 update works OK for Me

    I'm writing this after reading about problems some people are having with the PPro 5.0.2 update http://forums.adobe.com/thread/652694?tstart=0 has a link to what I built for CS5... I am using the 197.45 nVidia driver for my GTX 285 I edit AVCHD from

  • Modification of std form F140_ACC_STAT_01 for account statement

    Hi I want to do modification of std form F140_ACC_STAT_01 for account statement . Now can any body tell me how to find or what is the Application type for transaction NACE Output type and processing routine for this std form and how to find out all t

  • IDOC to File (BYpass)-- Error or Warning  :  " Message Branched. "

    HI all, Iam trying idoc to file scenario(bypass) my idoc is triggered succesfully and it is reaching to the receiver system. but the problem is in SXMB_MONI ,it is not showing my Receiver service details and showing with different symbol like " <b>>>