How to set main class in netbeans?

i have a class with a main method that i want to set as my main class, but i dont have the source for it. how can i set it as my main class in netbeans?
thanks!

ya i can run in from the comand prompt, Excellent.
and yeah your right it should be easy. It IS easy. You just did it.
but for the life of me i cant figure it out. What can't you figure out? How to do the same thing in NetBeans?
i dont know where else to turn.Let me suggest the NetBeans docs. I'm sure they've got something in there to tell users how to run a .class with a main() method.
Better yet, keep doing things on the command line until you're knowledgable about NetBeans and leave the IDE alone until you know Java. Two mysteries at once is too much.
%

Similar Messages

  • Error: "Could not find the main class: Files\NetBeans"

    I am working on a WorldWind mapping application but I think this issue is more of a straight Java question. I was attempting to add a web service reference by means of the NetBeans IDE. The reference compiled as it should have but then the application would not run. I deleted the reference, commented out all the code that used the web reference, basically restored all the code to how it was before trying to add the web service. The applicaiton still will not run with the message that it can't find the main class. I do, however, get a clean build. What should I do to fix this?
    Here is the error: "Could not find the main class: Files\NetBeans"
    thanks!

    nigel25840 wrote:
    I am working on a WorldWind mapping application but I think this issue is more of a straight Java question. I was attempting to add a web service reference by means of the NetBeans IDE. The reference compiled as it should have but then the application would not run. I deleted the reference, commented out all the code that used the web reference, basically restored all the code to how it was before trying to add the web service. The applicaiton still will not run with the message that it can't find the main class. I do, however, get a clean build. What should I do to fix this?
    Here is the error: "Could not find the main class: Files\NetBeans"
    thanks!Sounds like something (a .cmd file or .bat file, perhaps) is set up to launch NetBeans with a command line like this:
    java -classpath ... c:\Program Files\NetBeans ...
    So since the path has embedded space(s) in it, it thinks you are wanting to run a class named "Files\NetBeans", which does not exist.
    You need someone there who knows what they are doing to look into it for you.

  • How to create static class in Netbeans ?

    I want to create a static class in netbeans.
    But it gives error like : static modifier not allowed here. as far as java prog concern it is syntactically correct.
    for eg.
    public static class Emp
    -------body & methods
    it looks correct syntactically, but gives error in netbeans, static modifier not allowed here. Why ? How to create static class in netbeans ?

    DrClap wrote:
    I have occasionally seen the name "static class" used to denote a class whose members are all static.I think this is quite common.
    But taking the name literally and trying to declare a class "static" is a little naive."naive" or being used to doing that in C#.

  • How to set property classes at runtime.

    Well, as the subject line says my question is plain and simple. I don't see any property for this in SET_ITEM_PROPERTY built-in.
    Currently a form has 10 subclassed blocks and views. These blocks have almost similar/definite number of items. At a time only one block with its canvas will be shown to the user. Instead of using so many sub-classed objects, I would like to use only one block and canvas. Now I am looking get getting just property classes from the 10 child forms, which I am looking forward to apply to the common block and items. Any other ideas for the same also appreciated.
    Thanks,
    -- Raam.

    alsalamu alykom
    I think there is no way to set property classes at runtime.
    u must loop through the objects

  • How to set a class path in atuoexec.bat

    hello friends,
    How to set a classpath in autoexec.bat file. pls sent a path setting techniques to me.
    my JDK1.2 in "c dirve" so what can i do
    help me
    davipet

    What is your OS?
    If it is 95 or 98,
    add SET CLASSPATH=C:\Jdk1.2\lib\tools.jar;.; to your autoexec.bat file.

  • How to set DHCP Class ID in OS X 10.2 ???

    Hi everybody,
    At work we have a network that uses a specific DHCP class ID and the DHCP server does not issue IP's and stuff unless the class ID is correctly set on the client. I have been searching all over the net for the procedure to set the DHCP class ID in OS X, I know how to do it in Windows (ipconfig /setclassid) but I cannot find the OS X equivalent.
    Anybody can help?
    Thanks in advance,
    Virgil

    vzane:
    Welcome to Apple Discussions.
    I am not familiar with what you are trying to do. However, here are some links that may have some useful information for you:
    TCP/IP: IP Addresses for Private Networks
    Open Transport 2.0 Technical Information - Part 1
    May I further suggest that you post your question in the Networking and the Web Forum.
    Good luck.
    cornelius

  • How to set main host for Adapter Engine in the HA enviroment

    Hi, all.
    Our XI env. is like the following.
    XI 3.0 SP11 on Windows 2003 + SQL Server.
    Central Instance(ABAP + J2EE Addon) is running on Host A,
    Dialog Instances(ABAP + J2EE Addon) are running on Host B and Host C.
    Our design was to have J2EE Adapter engine mainly running on Host A(CI). But after installation, Adapter Engine is running on Host C(one of DIs). When we check from the Runtime WorkBench. It shows Adapter Engine is running on Host C while IS is running on the Host A(CI). 
    Where can we change this configuration? We want the J2EE AE running on the Central Instance Host.
    Any advice appreciated.
    Best Regards.

    Hi Sejoon,
    when we changed the host of XI server in one of our projects one of the things we had to change was the exchange profile entries
    http://server:port/exchangeProfile/index.html
    to see how your adapter engine is configured
    http://server:port/sld
    SLD -> Content Maintenance
    then
    Subset: landscape description
    Class: XI Adapter Framework
    buth check the exchange profile entries first
    Regards,
    michal

  • How to set DHCP class ID?

    Hi,
    I'm trying to connect through Built-in Ethernet to my office's Inter- and intranet, using their DHCP server. But the network is set up so that only when using a certain DHCP Class ID one gets access to the correct router and thus is connected through to the internet.
    For the Windows machines, they use the "ipconfig"-command that has a /setclassid option. This does not seem to work for the darwin "ipconfig". How then do I set the DHCP class ID?
    Barend
    iBook G4   Mac OS X (10.4.4)  

    vzane:
    Welcome to Apple Discussions.
    I am not familiar with what you are trying to do. However, here are some links that may have some useful information for you:
    TCP/IP: IP Addresses for Private Networks
    Open Transport 2.0 Technical Information - Part 1
    May I further suggest that you post your question in the Networking and the Web Forum.
    Good luck.
    cornelius

  • How to set the class path?-

    my forlder is :C:\Documents and Settings\india
    jdk is in:C:\Program Files\Java\jdk1.5.0_11\bin
    can any body can help me to create a classpath for my folder?

    An alternative - as stated in reply 2 in your other thread on this topic: http://forum.java.sun.com/thread.jspa?threadID=5170470 - is not to set the CLASSPATH environment variable at all. Use the -classpath switch instead.
    As the documentation linked to in that reply points out: "The class search path (more commonly known by the shorter name, "class path") can be set using either the -classpath option when calling a JDK tool (the preferred method) or by setting the CLASSPATH environment variable. The -classpath option is preferred because you can set it individually for each application without affecting other applications and without other applications modifying its value."
    As always, the documentation is worth reading; the available command line options worth using.

  • How to get main class name in running program?

    How can I get classname, which main method is executed? Of course in running program?
    Please help,
    Chris

    Something like (not tested this)StackTraceElement[] foo = new Throwable().getStackTrace();
    String whichClass = foo[foo.length-1].getClassName();

  • How to set main thread Priority?

    i have set:
    Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
    // and the other thread ( )
    thread_load = new Thread();
    thread_load.setPriority(Thread.MIN_PRIORITY);
    thread_load.start();but it doesn't make any diffrent,
    i mean diffent the CPU usage for the thread.
    i want the main thread has a MAX PRIORITY CPU usage , then the other thread.
    is this true to set the thread priority use setPriority(..) ?
    thx..

    Thread is a Runnable within java (or javaw) process: his priority has no meaning outside the JVM, if you wanna impact on CPU usage you should set this process priority, i.e. (for windows):
    instead of starting as
    javaw ....try
    start/min javaw ...You could need to quote the javaw command, to see all possible priorities see start help by typing start/? in cmd.
    Bye.

  • How to set Weblogic Server to NetBeans IDE

    Hi iam trying to add the weblogic server to the Netbeans IDE.
    but there is no option i found to add weblogic
    It is allowing to add
    SunJavaApplicationServer and Tomcat Servers which are bundled with the NetBeans IDE when i downloaded.
    Is it possible to add the Weblogic to NetBeans???
    if so how??

    i do not find any down loads regarding this plug-ins..
    can u pls give the correct url to down load the plug in .

  • 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 to Set CLASSPATH in Apache Web Server Using IAS

    Hi,
    I have problem setting the classpath for the servlet I am using for file uploading...My work environment is Web Server is Apache with Oracle8i IAS on Sun Solaris..
    I have tried various method like setting wrapper.classpath=/oracle/ias/Apache/Jserv/servlets and my class resides under /oracle/ias/Apache/Jserv/servlets/com/oreilly/servlets/MultipartRequest.class
    in the Jserv.properties, still it get the error message class ...not found in type declaration when I compile the code...my reference to the servlet in my JSP code is com.oreilly.servlet.MultipartRequest ..
    Can someone help me out please, if you have have any idea of how to set the class path with the working environment I have specified ealier....
    null

    have you posted this on the ias 9i forum where the ias 9i apache experts are at ??

  • OK - I can set the Class Path. Now - what else?

    Dear all,
    I read with interest the many posts in this forum debating whether to use an IDE for your Java development, or to use some other (more primitive????) means of crafting code - notepad for example. As I understand things:
    If I use notepad and the command line to build, run, and compile my classes, then I will hopefully come to learn and understand how to set my class path correctly, and gain an insight into the environment in which I work - an insight moreover, that I might not happen upon if I leave an IDE to do all this for me. Ok - fine, I can use my IDE, but also do some testing on the command line to fill this gap in my knowledge.
    If I use an IDE to help me build my UIs, then it is more than likely that I will progress through life without a profound knowledge or understanding of layout managers, cell renderers, event handelers etc. OK - this is fine too, and I have decided to craft my UI 'by hand' because I want a broad appreciation of Swing and anyway, after the initial pain (akin, I imagine, to child birth), it's not so bad really.
    Now I feel I am cooking. I understand my environment, and the more esoteric features of Swing; I use my IDE to fashion my code - it's cool and helps me with code completion, and direct access to the API documentation as I type, and it does a whole bunch of refactoring stuff too.
    I feel as if I am getting the best from both worlds now.
    Would anyone argue against an approach such as this?

    ChuckBing wrote:In general, a good approach. You're correct, using the IDE will make life easier.
    What you have to watch out for is using it as a crutch. If it ever does something that you can't do, or don't know why it's doing "that", then you aren't learning. The next time "that" has to be done, if the IDE isn't available to do "that" for you, you're dead.
    Then you'll be posting the "how do I do that outside the IDE" question here.
    Make a promise to yourself: You'll learn why and what the IDE does, and read the API's - A lot!Yes, I agree Chuck. I am not comfortable with a tool doing something for me which I don't understand; which is one of the reasons I build the UIs by hand.
    I also become somewhat downcast when I see people in the forums requesting code so they can simply paste it into their aplpications. Learning can be painful, but it is a necessary pre-requisiite to knowledge in my view - so copy/paste can be a most harzardous thing.
    I am hoping this thread will be a small guide to new folk.
    Thank you for your input,
    Steve

Maybe you are looking for