High School Teacher still needs help.

Hello, I am a high school math teacher and this is my second post for help writing my first java appet using :

 Microsoft Visual J#.NET

Microsoftw Development Environment 2003 Version 7.1.3008

Microsoft.Net Framework 1.1

 I have gotten help from Christian Graus and Jaiprakash previously and I thank them, but I still have not gotten my first applet to run.  I am trying to use the code for the applet at

http://www.mrpowell.net/progra/java/example1.htm which was written in j++ by myself.

 As Jaiprakash suggested,  I first installed "J# Browser Controls" at:

http://www.microsoft.com/downloads/details.aspx FamilyID=56f93960-0198-4cd1-b58c-55579200682f&displaylang=en

 I then used the following steps

 

1. I click File/New/Project

2. Clik on Visual J# projects in Project Types treeview

3. Select Class Library from Templates

4. Click Ok.

5. I then name my project "Ex1" without quotes

6. This automatically creates a stubbed Class.js1 in the text editor, so

I delete all the text and replace it with the code at http://www.mrpowell.net/progra/java/example1.htm .  Replacing "Example1" with "Ex1"

7. then I save the text file as Ex1.java

8. I select Build/Build Solution  and I get "1 succeeded, 0 failed, 0 skipped"

9. Next I select Debug/Start without Debugging

 
I then get the following error message:

 "A project with an Output Type of Class Library cannot be started directly.

In order to debug this project, go to the Debugging tab under Configuation Setting in

Project Properties, and set the Start Action to Start External Program or Start URL. 

Alternatively, you can add a non-library project to this solution that uses a reference

to this project and set it as the startup project."

 I have worked with this error unsuccessfully for awhile.  I am not sure what tabs this messages is talking about.  I am not sure if the tabs are located at here : see image at:

http://www.mrpowell.net/java/jmain.jpg

 or here when clicking Project/Properties

 http://www.mrpowell.net/java/pp.jpg

If anyone can help me out on this one, I would appreciate it.  My students are waiting for me to figure this out so we would both be grateful for your time.

 
Sam Powell

Northridge High School

Middlebury Indiana

 

 

 

 



Answer this question

High School Teacher still needs help.

  • satish G

    Hi Sam

    First thing I would like you to try, is to reinstall J# Browser controls v1.1b, from the link given below. I have a feeling that you have JBC v1.1 installed on your machine, which is a previous version and requires you to host the applets on a webserver.

    http://www.microsoft.com/downloads/details.aspx FamilyId=D931BF62-D2EC-49C9-96F3-EF0F0B2E450C&displaylang=en

    Instructions :

    1) Uninstall Microsoft J# Browser controls from control panel\add-remove programs
    2) Install J# browser controls from the link specified above..

    After the installation is over, try opening the html file again using IE. I recommend that you rebuild your project before opening the html file. 'J# Browser Controls security' application in Control panel/Administrative tools is something that you might want to check too.

    I am hoping that you will see your applet now.. Let me know if it doesn't happen.

    To your question abbout PDB files :

    * PDB files are used while debugging , to trace the source code lines corresponding to the intructions that are really executed during runtime. i.e You can step through you J# source code inside a debugger if you have the pdb files, which can be obtained using the /debug switch during compilation. VS is doing that by default for you.

    Thanks

    With regards
    Ashwin Raja

  • SergeVV

    Ashwin,< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

     

    Thanks to you I have finally been able to get the applet to run.  Our school appreciates your time, but I do have a few unanswered questions that I would like you or anyone else to answer.

     

     

    1.)      I am trying to show my students how to write java applets at a high school that requires students to save files on a server which is not accessible via the internet.  I would also like to keep up with technology and show kids what is current.  In the past, I have used J++ to do this. At this time what is the best Microsoft software that will accomplish my needs   Is it J# 2003 or another

     

    2.)   Ashwin wrote this HTML file for me which works fine with my applet. 

     

     

    <OBJECT  WIDTH="600" HEIGHT="600"

    CLASSID="clsid:a399591c-0fd0-41f8-9d25-bd76f632415f"

    VJSCODEBASE="Ex1.dll#Example1" ID="Object1">

    </OBJECT>

     

     

    I would like to know what the CLASSID attribute is all about in his HTML file.  I took it out and my applet will not run.  If my students write their own applets, will they use this same class id

     

    Thanks for reading and your time.

     

    Sam Powell

    Northridge High School

    Middlebury Community Schools

     


  • poiuytrewq

    A project with an Output Type of Class Library cannot be started directly.

    This means you've built a class library, which is a bunch of code in a dll.  A class library does *something*, but it doesn't know how to do it, that is, it doesn't have a way to start or to use itself.  It's basically a library that another application will use. 

    According to http://msdn.microsoft.com/library/default.asp url=/library/en-us/dv_vstechart/html/vjtskMigratingJavaAppletsToMicrosoftJBrowserControls.asp, you need to set up a HTML page to use your control, and then you can view it in your browser.  It has instructions, you'd do better to read them than for me to try and explain, only because I don't use J#, so I may do a botch job of it.

    Good luck !!


  • wrd

    Hi,
    You should probably use Eclipse or JCreator. I used JCreator last year for computer science ap A as a student and it was great. It has an installed applet viewer so internet connection is not required to view your applets. Visit www.sun.com for more information. I would not recommend J# for the high school level becuase it does not let the students program fully by including a GUI. If you want them to learn to program, teach them to instantiate objects and create their own GUI using java.AWT.graphics. J# is a fun program but it is too similar to vb in its interface, making things easier than they are. You should be able to gauge the abilities of your students and choose the best program for them. Good Luck!
    bathtank@yahoo.com 



  • Ghostgollum

    I want to thank Christian and Ashwin for helping out again, but I am still having some difficulties.  My “Ex1.dll” file was created successfully, in the following directory

    C:\Documents and Settings\powells\My Documents\Visual Studio Projects\Ex1\bin\Debug< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


    At the same location, I have a PDB file named “EX1”, I am not sure what that is for but I guess that does not matter.  To make sure I was using the correct path of the .dll file, I placed my HTML file in the same folder as “Ex1.dll”  This is the exact contents of my HTML file

     

    <OBJECT  WIDTH="600" HEIGHT="600"

    CLASSID="clsid:a399591c-0fd0-41f8-9d25-bd76f632415f"

    VJSCODEBASE="Ex1.dll#Example1" ID="Object1">

    </OBJECT>


    I am not sure what that Classid is all about.  I just used that same one that Ashwin gave me in his example.  Do I need to change mine and if so, how do I do that

     

    When I run the HTML file all I see is a blank applet.  I don’t know if this has anything to do with it but after that, I did go to internet options in IE explorer and enable the “Java console” and “Java logging”.  but received the same results.  “Java (Sun)” and “Jit compiler for virtual machine” was already enabled.

     

    Another thing, each time I run the HTML file, I get an information Bar that wants to know if I want to allow Blocked content.  I just select “allow Blocked content”

    and the HTML file loads but with a blank applet.
     

    If anyone has any suggestions, I am open to them.  I just want to get this figured out soon so I can show my students.

    Sam Powell
    Northridge High School
    Middlebury Indiana


  • John Mitchell

    Hi Sam

    Good that you are able to build the project successfully and generated the JBC/applet dll. You will see the dll(in your case Ex1.dll) in the bin\debug folder under this project.

    Now you need a html file to be able to see this JBC/applet (I will call them JBC hereafter).

    If you prefer, you may create the html file with VS as follows. (You can create the html file seperately too without using VS)

    1) In the solution explorer, right click on the project and add a new item.. html page will be one the choices displayed, which you can choose.

    2) Inside the body tag of the html page generated, insert something like this. Make sure that the VJSCODEBASE attribute has the correct relative or absolute path to the applet's dll. Ex1.dll is the dll name in the sample below and Example1 is the name of the Applet class inside that dll.

    <OBJECT WIDTH="600" HEIGHT="600" VJSCODEBASE=".\bin\debug\Ex1.dll#Example1" CLASSID="clsid:a399591c-0fd0-41f8-9d25-bd76f632415f" ID="Object1" >  
    </OBJECT>

    3) After saving this project, open this html from its location (project location) using IE and you should see the applet.

    Let me know if this doesn't help.

    Thanks

    With regards
    Ashwin Raja


  • Peter Marshall

    Hi Sam

    1)   I am trying to understand this question better.

    a)   As of now, I am just trying to guess your question here..
    What would you mean by saving files on a server not accessible via the internet Is the server accessible from all machines in the lab Do you want your students to be able to write files into this server, using programs running on the client machines on which they are sitting

    b)   Also what files are you talking about Do you mean the source files for your project or were you talking about other data files etc, which is generated or modified by the applet

    2) CLASSID is an ID used to identify the JBC Hosting control, which IE will load and thereafter the JBC Hosting control takes care of loading the applet/JBC etc, from the dll pointed to in the html file.. So, you need to mention the CLASSID in the OBJECT tag, in the html file, to help IE load the Hosting control appropriately. and Yes, you have to use the same CLASSID mentioned in the previous post, to load the JBCs.

    Its great to hear that you would like to keep up with technology and show the kids current stuff. We released the latest version of Visual Studio 2005 and Visual J# 2005 along with it, last month. You should consider checking that out.  

    Here is an introduction to Visual J# 2005 from our Program Manager, Pratap.

     http://www.microsoft.com/downloads/details.aspx FamilyID=1aefd6b3-485f-48d9-81f1-2b0427d428b8&displaylang=en

    and here is the transcript for the same

      http://msdn.microsoft.com/msdntv/transcripts/20050324JSHARPPLTranscript.aspx

    Do look at Visual J# Express Edition too, using the following link..

      http://msdn.microsoft.com/vstudio/express/visualJ/default.aspx

    Let us know what you would like to showcase to your kids and we can suggest technologies and methods regarding the same.

    Thanks

    With regards
    Ashwin Raja

  • High School Teacher still needs help.