facebook

classpath & java application

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #206323 Reply

    qingster_xie
    Member

    Hi,

    I’m developing a simple java application (not web application) which needs classes in an external .jar file( com.mysql.jdbc.Driver). The application will be run on command line. How do I make this jar file available for the application? Is there a way to add it to “classpath” through myEclipse?

    Thanks,

    Qing

    #206334 Reply

    Riyad Kalla
    Member

    Yes definately, right click on your project root, go down to Properties, and then select “Java Build Path”, then select the “Libraries” tab. This is where you add it. If the JAR file is IN your project (maybe in a subdirectory somewhere) then use the “Add JAR/ZIP” button, if the JAR is someplace else on your hard drive, use the “Add External” functionality to point to it.

    #206409 Reply

    qingster_xie
    Member

    But the problem is that, when I open the property window for the project, I couldn’t find “Java Build Path” option. The only one available is “Java Builder”.

    Maybe the way I created this project is wrong. What I did was file -> new project -> Java -> Java Project.

    Thanks for your help,

    Qing

    #206414 Reply

    Riyad Kalla
    Member

    Qing,
    You know what I think you did on accident, was create a “Simple Project”. Try and recreate the project and be very careful to select either “Java Project” or “Web Module Project” depending on what you are working on. THEN try and click on the root, and go to Properties. If you see more things, then that is the problem.

    The reason I say this is that I’ve done this before and remember going nuts checking my log file trying to figure out where all the options went 😉

    #206520 Reply

    qingster_xie
    Member

    Hi Riyad,

    I did what you suggested: recreating the project. The mistake I made was I skipped one step when I created the project.

    Wrong way: file->new project -> java -> next button -> type project name -> finish.

    Right way: file->new project -> java -> next button -> type project name -> next button -> add external jars -> finish

    So, I can add external jars when I create the project. But after that, I still cannot find the options to add or remove jars. I tried right click on the root of the project -> properties. In the left frame, there is only one choice: External Tools Buiders. In the right frame, there is only one choice only: java buider.

    So, where did I do wrong?

    Thanks,

    Qing

    #206542 Reply

    Riyad Kalla
    Member

    This is very strange! I think something is wrong with your Eclipse install, can you open up your log file and see if you are getting any exceptions? (<workspace>\.metadata\.log)

    #206551 Reply

    qingster_xie
    Member

    There are a lot of exceptions. Here is the most recent one:

    !ENTRY org.eclipse.help.appserver 4 0 Apr 22, 2004 16:27:18.687
    !MESSAGE Exception occurred starting application server.
    !SUBENTRY 1 org.eclipse.help.appserver 4 0 Apr 22, 2004 16:27:18.687
    !MESSAGE Exception occurred starting application server.
    !SESSION Apr 22, 2004 17:10:00.250 ———————————————
    java.version=1.4.2_03
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/
    !ENTRY org.eclipse.core.runtime 4 2 Apr 22, 2004 17:10:00.265
    !MESSAGE Problems occurred when invoking code from plug-in: “org.eclipse.core.runtime”.
    !STACK 1
    org.eclipse.core.runtime.CoreException: Exception occurred starting application server.
    at org.eclipse.help.internal.appserver.AppserverPlugin.startWebappServer(AppserverPlugin.java:163)
    at org.eclipse.help.internal.appserver.AppserverPlugin.getAppServer(AppserverPlugin.java:53)
    at org.eclipse.help.internal.appserver.WebappManager.stop(WebappManager.java:58)
    at org.eclipse.help.internal.HelpSystem.shutdown(HelpSystem.java:160)
    at org.eclipse.help.internal.HelpPlugin.shutdown(HelpPlugin.java:100)
    at org.eclipse.core.internal.plugins.PluginRegistry$2.run(PluginRegistry.java:295)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1006)
    at org.eclipse.core.internal.plugins.PluginRegistry$1.visit(PluginRegistry.java:308)
    at org.eclipse.core.internal.plugins.PluginRegistry.accept(PluginRegistry.java:58)
    at org.eclipse.core.internal.plugins.PluginRegistry.shutdownPlugins(PluginRegistry.java:311)
    at org.eclipse.core.internal.plugins.PluginRegistry.shutdown(PluginRegistry.java:277)
    at org.eclipse.core.internal.runtime.InternalPlatform.loaderShutdown(InternalPlatform.java:630)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.internal.boot.InternalBootLoader.shutdown(InternalBootLoader.java:1008)
    at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:863)
    at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
    at org.eclipse.core.launcher.Main.run(Main.java:747)
    at org.eclipse.core.launcher.Main.main(Main.java:583)
    !ENTRY org.eclipse.help.appserver 4 0 Apr 22, 2004 17:10:00.281
    !MESSAGE Exception occurred starting application server.
    !SUBENTRY 1 org.eclipse.help.appserver 4 0 Apr 22, 2004 17:10:00.281
    !MESSAGE Exception occurred starting application server.

    Qing

    #206559 Reply

    Riyad Kalla
    Member

    There are a lot of exceptions. Here is the most recent one:

    Please post them all.

    #206583 Reply

    Riyad Kalla
    Member

    Here are some screenshots showing what we are saying so you can compare

    Click on Project Root, Click on Properties

    Click on Java Build Path to setup JARs

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: classpath & java application

You must be logged in to post in the forum log in