facebook

MyEclipse Java Class Files

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #261803 Reply

    rigasminho
    Member

    Hello,
    I’m trying to setup the project environment in myEclipse 5.0

    I have the file folder setup for a JSP workspace.

    It makes the folders and i move the files i have from before into those folders.
    However i have a Java class file that needs to be used by the application. However the Java class file isnt called upon correctly in my application – or myEclipse forces it to give it errors when in reality it’s there.
    <jsp:useBean id=”eagle” class=”bird” scope=”request”/>

    MyEclipse basically doesnt know where this class file is stored. I dont have the Java file that made this class so maybe myEclipse needs a java file stored in the SRC folder?

    Any Ideas?

    #261818

    Riyad Kalla
    Member

    The first problem I see is that your bird class has no package. You need to place it in a package. Also yes, if you don’t include the source code in your source folder, and only include the class in your output folder, your class will be erased every time your project builds. Part of the build cycle in Eclipse is to clear the output package before each compile.

    #261896

    rigasminho
    Member

    So basically if i dont have the source file i’m screwed huh?

    Because right now i only have the class file.

    #261897

    Riyad Kalla
    Member

    No, not screwed. Just a bit more configuration to stop the default “cleaning” behavior.

    I believe if you pop open your project properties, go to Java Compiler, then Building, you can turn off the “scrubbing” of the output dir when the project builds. Then place the class in the appropriate package and try and rebuild your project.

    After rebuilding, check that the class file didn’t get erased from the output dir. If the error is still marked in the JSP page, chances are that the use of the default package is what is making it mad. If you are using 5.1, you can simply exclude this file from validation to get rid of those error markers if you know the page works and just don’t want to be bothered by it.

    #261905

    rigasminho
    Member

    Thanks – I turned off scrubbing but you’re right:
    Now it gives me the errors on the jsp sections.

    How would you exclude the file from validation?

    #261907

    Riyad Kalla
    Member

    You can right click on the file, go down to MyEclipse, then select “Exclude from Validation”. You can manage these files under your project properties, then under MyEclipse > Validation > Exclusion.

    #261921

    rigasminho
    Member

    Darn – I tried doing the exclusion and now myeclipse works pretty well with it. However when I try to load up the files in Tomcat it gives me the error that the symbol can not be resolved.

    So basically what i need to do is make the command line:
    <jsp:useBean id=”eagle” class=”bird” scope=”request”/>

    Somehow see the class “bird” even though the java file isnt there but the class file is 🙂

    #261926

    Riyad Kalla
    Member

    Actually if Tomcat can’t see the file either, then you might have a legitimate problem and want to reenabled validation on this file.

    Also you might just have your fully qualified class name wrong… you sure there is NO package and that the class is actually named “bird”, like:
    public class bird

    ?

    This is horrible practice…

    #261930

    rigasminho
    Member

    Eh – if you worked where I worked this would all be part of the normal day 🙂 Yeah my job was to migrate applications from bea weblogic to websphere. But the files I got had no java source files only class files so in turn the beans cant find the class correctly.

    Hmmm well i can use cavaj to make the java file from the class right?
    In that it has:
    public bird()

    And yes I tried making the java file by cavaJ and it still doesnt help because the program doesnt make the file correctly.

    Steps I’ve done:
    Made the project space in MyEclipse 5.0
    Copied over the files into teh folders manually
    Copied over the class file into the web-inf / class sub folder
    Deployed to Tomcat

    still error on finding that class file.

    #261932

    rigasminho
    Member

    Is there a way in myeclipse for it to point to the class file manually? Instead of having it look for it in some location that is wrong?

    #261942

    Riyad Kalla
    Member

    Eh – if you worked where I worked this would all be part of the normal day 🙂

    Ha, fair enough.

    In that it has:
    public bird()

    you mean the constructor looks like that? Is there a package statement of any kind? Like com.company? If so, your class arg in the taglib needs to be the whole fully qualified class:
    com.company.bird

    Is there a way in myeclipse for it to point to the class file manually? Instead of having it look for it in some location that is wrong?

    Well here’s the problem, is that Tomcat isn’t compiling the page correctly either, so I think you have a real problem, not just a “MyEclipse doesn’t understand my page” problem. You will need to figure out the right package and name for the class and then make sure to indicate it correctly in your JSP page.

    To answer your question though, no.

    #261957

    rigasminho
    Member

    you mean the constructor looks like that? Is there a package statement of any kind? Like com.company? If so, your class arg in the taglib needs to be the whole fully qualified class:
    com.company.bird

    Yeah definately no package is made / brought into.

    Hmm so now the question becomes how do I make tomcat recognize the class file i have 🙂

    #261959

    Riyad Kalla
    Member

    I’m not sure off hand. Try googling for Tomcat Class default package or something.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: MyEclipse Java Class Files

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