Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-09-2008
gsteele9 gsteele9 is offline
Registered User
 
Name: Greg Steele
Organization: Retired
Project: Backup System
 
Join Date: Jul 2008
Posts: 16
Exclamation What Development Environment to use for Java

I'm looking for the easiest way to develop at least parts of an ICE application in Java.

In the past, I've used Eclipse for Java and Visual Studio 2005 for C# or VB. It looks like there is no usable Eclipse plugin for ICE and I don't know how to develop a Java application with VS2005. I've tried Gaylord Fureau's IcEclipse plugin for Eclipse at ICEEclipse - A plugin for the IDE Eclipse, but it looks like nobody's updating it and it supports an old version of ICE.

Your download description for the "Windows Installer for Visual Studio 2005 SP1" refers to Java. Is there something I'm missing in VS2005 that would let me develop Java apps? As an alternative, is there any hope for an Eclipse plugin? Should I drop back to command line stuff for ICE/Java?

Thanks in advance for any suggestions you can make.
Reply With Quote
  #2 (permalink)  
Old 07-11-2008
mefoster mefoster is offline
Registered User
 
Name: Mary Ellen Foster
Organization: Heriot-Watt University, Edinburgh
Project: ECHOES learning environment
 
Join Date: Jun 2006
Posts: 111
I use Eclipse to develop my Java Ice servers. I use the old "IcEclipse" plug-in purely to provide syntax highlighting -- it's not useful for much more. But it's not too hard to set up a good Ant build.xml file and ensure that slice2java gets run at appropriate points in the project's lifecycle, and that's worked pretty well for me.

In my build.xml, I have two targets that looks like this (where JAST_ICE_DIR is the directory where my *.ice files are, and all of my files are in the "jast" module):
Code:
    <target name="slice2java">
        <mkdir dir="src" />
        <slice2java outputdir="src">
            <includepath path="${env.JAST_ICE_DIR}" />
            <includepath path="${ice_slice_dir}" />
            <fileset dir="${env.JAST_ICE_DIR}/jast">
                <include name="common/Agent.ice" />
                <include name="common/Object.ice" />
                <!-- ... and so on ... -->
            </fileset>
            <meta value="java:java5" />
        </slice2java>
    </target>

    <target name="clean-slice2java">
        <delete dir="src/jast" />
        <delete file="src/.depend" />
    </target>
You also need to make sure to "taskdef" the Ice Java tasks properly; this may be in the Ice documentation, but if not, ask me.

Then, in Eclipse, you need to set things up like this; this is based on instructions I wrote up for my colleagues recently.
  1. Right click on the project and choose Properties. Inside that window, choose Builders, click on New ..., and then choose Ant Builder and press OK
  2. On the Main tab, give it whatever name you want (e.g., "slice2java builder"). For the Buildfile, click Browse Workspace, select your new project on the left, and then select build.xml on the right and press OK. Press Apply.
  3. Choose the Refresh tab. Check Refresh resources on completion. Choose Specific resources and then click the Specify Resources ... button. Open the tree under your new project and check the box next to the src directory. Press OK and then Apply.
  4. Choose the Targets tab. You need to change the targets to run in all four of the situations: for During a “Clean” choose the clean-slice2java target and un-check all other targets; for the other three, choose slice2java and un-check the others. Once you’ve chosen the targets for all four fields, press Apply.
  5. Choose the Build Options tab. Check Specify working set ... and press the Specify Resources ... button. Browse to your project and select its build.xml file. Press Finish and then OK.
  6. Back in the Builders screen, select the new builder you just added and move it above the default Java Builder. Press OK.
If you're lucky, the project will now automatically call slice2java before trying to build itself, and all of your interfaces will be available.

I hope this is sort of useful. Let me know if something doesn't work and I can clarify.

MEF
__________________
Mary Ellen Foster
Reply With Quote
  #3 (permalink)  
Old 07-12-2008
gsteele9 gsteele9 is offline
Registered User
 
Name: Greg Steele
Organization: Retired
Project: Backup System
 
Join Date: Jul 2008
Posts: 16
Thanks for your suggestions

Thanks a lot for taking the time to respond.

I'll have to do some reading on Ant, but could you tell me which "Ice Java tasks" need to be taskdef'd? I couldn't find any occurrences of "taskdef" in the ICE pdf.

Thanks again for your help.
Reply With Quote
  #4 (permalink)  
Old 07-14-2008
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 920
Hi Greg,

Mary Ellen is referring to the ant taskdef in the common.xml file that comes with the Ice Java demos build system:

Code:
    <!-- Install the Slice ant tasks. -->
    <target name="task-init">

        <condition property="task.jar.file" value="${dist.lib.dir}/ant-ice-${ice.version}.jar">
            <available file="${dist.lib.dir}/ant-ice-${ice.version}.jar"/>
        </condition>

        <condition property="task.jar.file" value="${dist.lib.dir}/ant-ice.jar">
            <and>
                <not><isset property="task.jar.file"/></not>
                <available file="${dist.lib.dir}/ant-ice.jar"/>
            </and>
        </condition>

        <taskdef name="slice2java" classpath="${task.jar.file}" classname="Slice2JavaTask"/>
        <taskdef name="slice2freezej" classpath="${task.jar.file}" classname="Slice2FreezeJTask" />

    </target>
Best regards,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #5 (permalink)  
Old 07-15-2008
gsteele9 gsteele9 is offline
Registered User
 
Name: Greg Steele
Organization: Retired
Project: Backup System
 
Join Date: Jul 2008
Posts: 16
Thanks Bernard. I can see that I'll need to educate myself on Ant. I think I understand how it will help. These posts will be very useful to me.
Reply With Quote
  #6 (permalink)  
Old 07-18-2008
gsteele9 gsteele9 is offline
Registered User
 
Name: Greg Steele
Organization: Retired
Project: Backup System
 
Join Date: Jul 2008
Posts: 16
I got it working. Thanks to both Bernard and Mary Ellen for their help.

I was thinking that I'd have to write all the Ant tasks, but after Bernard's note I realized that all I needed was a taskdef equating slicetojava to the Slice2JavaTask included in ant-ice.jar.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment variables for java IceBoxin IceGrid Sameerrele Help Center 4 10-10-2006 05:24 PM
Question about ICE_CONFIG environment variable in Ice for java ? rc_hz Comments 2 09-18-2006 05:54 AM
New features in development for Ice 1.6 mes Announcements 0 09-10-2004 06:28 PM
Cross development ahartveld Help Center 0 01-08-2004 11:44 AM
development roadmap tom Comments 2 09-26-2003 03:41 AM


All times are GMT -4. The time now is 08:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2009 ZeroC, Inc.