facebook

I can´t add .class files to my project

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #196820 Reply

    sitomania
    Member

    Hello ( again ),

    I have a problem that it is driving me crazy.

    I have a folder with serveral classes that have to be accessed in runtime, so I added the folder to the windows classpath but it does not work with eclipse. I tested with a notepad java program and i worked fine.
    The next step was to add it to the project and then :
    add to the build classpath : didnt work
    add to the .classpath: did not work
    create a jar and placed it on the web inf: did not work
    place the folder in the web inf folder: did not work
    ….
    Please help!!!!!!!

    thanks in advance!!

    sitomania

    #196822 Reply

    Scott Anderson
    Participant

    From the post, it sounds like you’re new to Eclipse, not just MyEclipse. Eclipse has a lot to offer, but it operates differently than other IDE’s with which you might be familiar. For example, it doesn’t use anything on the Window’s classpath. Before you become frustated with these types of issues, I’d highly recommend that you take a few minutes and read the “Java Developement User Guide”. You can access it at Help->Help Contents->Java Development User Guide.

    After that, please read the up to date MyEclipse web project setup and debugging tutorial at http://myeclipseide.com/enterpriseworkbench/help/index.jsp

    We’ll still help you, but you need to begin by helping yourself first. 🙂

    Now, for your question:

    create a jar and placed it on the web inf: did not work
    place the folder in the web inf folder: did not work

    To add class files to the path of a web project you can choose to do one of two things. You can create a jar archive of the class files and place the jar in the WEB-INF/lib directory of your web project. Alternatively, you can add the java source files into the source folder for your web project and when they’re compiled they’ll be placed in WEB-INF/classes. Either way will work, the difference being whether or not you have access to the source.

    –Scott
    MyEclipse Support

    #196824 Reply

    Wayne Kidd
    Member

    @scott wrote:

    From the post, it sounds like you’re new to Eclipse, not just MyEclipse. Eclipse has a lot to offer, but it operates differently than other IDE’s with which you might be familiar. For example, it doesn’t use anything on the Window’s classpath. Before you become frustated with these types of issues, I’d highly recommend that you take a few minutes and read the “Java Developement User Guide”. You can access it at Help->Help Contents->Java Development User Guide.

    After that, please read the up to date MyEclipse web project setup and debugging tutorial at http://myeclipseide.com/enterpriseworkbench/help/index.jsp

    We’ll still help you, but you need to begin by helping yourself first. 🙂

    Now, for your question:

    create a jar and placed it on the web inf: did not work
    place the folder in the web inf folder: did not work

    To add class files to the path of a web project you can choose to do one of two things. You can create a jar archive of the class files and place the jar in the WEB-INF/lib directory of your web project. Alternatively, you can add the java source files into the source folder for your web project and when they’re compiled they’ll be placed in WEB-INF/classes. Either way will work, the difference being whether or not you have access to the source.

    –Scott
    MyEclipse Support

    It should also be noted that the folder structure of the class files and the jar file need to reflect the package declaration of the java classes.

    Wayne

    #196836 Reply

    sitomania
    Member

    Hello,
    I have a jar where I put all the classes I need taking care of keep the directory struture but it does not work. Should I name the jar file with a special name? Or should I add the jar to some kind of classpath ? I need to access the classes of this jar in runtime

    #196837 Reply

    sitomania
    Member

    Ok it works,
    thansks for your help!

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: I can´t add .class files to my project

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