WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do i insert a java program I created? (4 posts)

  1. rich1990
    Member
    Posted 1 year ago #

    Hello, I created a simple Java program. I tried uploading the .class file to my site and tried implementing it in a page, but the applet says it still can't find the .class file. what do i do??

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Try using full (absolute) urls to point to all .class files.

  3. rich1990
    Member
    Posted 1 year ago #

    I am doing that and it still won't work. Here's my code:
    <applet code="http://example.com/wp-content/uploads/JavaMain.class" width="400" height="400"></applet>
    And I get the error "ClassNotFoundException: http:..example.com.wp-content.uploads.JavaMain.cass"

  4. rich1990
    Member
    Posted 1 year ago #

    Wow that was a very easy fix! This did it:

    <applet codebase="http://example.com/wp-content/uploads/" code="JavaMain.class" height="200" width="200"></applet>

    I knew it was something simple, I just had to specify the codebase field. If anyone else has this problem, the above solution should fix it.

Topic Closed

This topic has been closed to new replies.

About this Topic