You can install Eclipse and Java on a USB drive, and run Eclipse from a Mac with a USB port. Keep in mind that it can be slow to access Eclipse following this approach. You need around 1GB just for Eclipse and Java, therefore a USB drive of at least 2GB is recommended.
Make sure you format the USB drive for Mac rather than FAT32 or NTFS otherwise an error could occur when launching Eclipse. Use "Get Info" to find information about the drive.
Define the workspace on the USB drive as follows:
In Eclipse define the JRE present on the drive as the one to use for projects as follows:
Select Eclipse → Preferences → Java → Installed JREs → Add... → Standard VM → Next> → Directory..., and select the HOME folder associated with the JDK. Make sure you select this JDK as the default in the "Installed JREs" section (where you see "Name, Location"). To select it as default, check the box next to the JRE and click on the Apply and Close button. When you create a Java Project, make sure you select the "Use default JRE ..." option so the USB JRE is used. Once a project has been created you can also change the particular JRE to use. Just right-click on the "JRE System Library", select Properties → Alternate JRE: → Installed JREs", and the appropriate JRE.