如何让我的程序运行在eclipse之外 [英] How to get my program to run outside of eclipse

查看:182
本文介绍了如何让我的程序运行在eclipse之外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中有一个项目。当我点击IDE中的绿色圆圈播放按钮时,它会做所有我想要的操作 - 打开窗口,播放东西,一切。但是,尽可能的尝试,我无法弄清楚如何在eclipse之外做到这一点。



我的项目使用processing.core库来做一些但是我无法使该项目在Processing IDE中运行,因为有一些愚蠢的东西关于我的一个类不是一个有效的代替 Collections.sort(List&T> ;)。如果有人知道如何将它从Processing IDE导出,那将是非常好的。



我需要能够通过电子邮件/上传到互联网/否则传输某种文件/文件夹/网页允许收件人在没有太多技术知识或工作的情况下,查看一个窗口或允许他们查看和与程序交互的东西,方式与我能够与当我按顶部的播放按钮时,Eclipse启动的窗口。



我已经尝试了几种不同的方式来完成这个,但没有一个工作。我尝试导出一个可运行的 .jar ,但它不会让我包含引用的库。我尝试了一个常规的 .jar ,但是我不知道如何打包,以便能够查看它。我甚至尝试使用fat jar eclipse插件,但是我遇到了一些关于无法找到项目主要的 PApplet 类的东西。 p>

如果有人知道如何获得我想要发生的事情,或者知道如何做我想要的一个很好的教程,我将非常感谢任何一种帮助或指导或任何东西。



Google无法帮助解决这个问题,因为我发现的大部分结果只是其他人提出相同或类似的问题,那么没有任何答案,或者我已经尝试过的东西,没有指出我需要什么样的选项或设置才能完成任务。



我正在使用版本2.0b7中的 processing.core.jar ,但我不认为这会有所作为,虽然我打算尝试使用不同的版本,如果我无法找出任何其他的东西。



我的项目的副本文件夹可以在(Java SDK将需要更改)。可以在这里获得带有bash脚本的导出的可运行jar。



这里是应该在Linux上运行的bash脚本本身:

  java -Xms128M -Xmx1024M -jar Processing-DataVisualization.jar 

很酷的项目btw。


I have a project in eclipse. It does everything I want it to do when I click on the green circle play button in the IDE - opens the window, plays the stuff, everything. But, try as I might, I cannot figure out how to get it to do that outside of eclipse.

My project uses the processing.core library to do some of its stuff, but I am unable to get the project to function in the Processing IDE, because of some stupid stuff about one of my classes not being a valid substitute for the type parameter for Collections.sort(List<T>). If anyone knows how I can get it to export from the Processing IDE, that would be excellent.

I need to be able to email/upload to the internet/otherwise transmit some kind of file/folder/webpage that allows the recipient to, without much technical knowledge or work on their part, view a window or something that allows them to view and interact with the program in the same way I am able to interact with the window that Eclipse launches when I press the play button at the top.

I have tried several different ways of accomplishing this, but none of them have worked. I tried exporting a runnable .jar, but it wouldn't let me include the referenced libraries. I tried a regular .jar, but I don't know how to package that up with whatever is needed to be able to view it. I've even tried using the fat jar eclipse plugin for it, too, but I ran afoul of something about being unable to find the main PApplet class for the project.

If anybody knows how to get what I want to happen, or knows of a good tutorial on how to do what I want, I would greatly appreciate any sort of assistance or guidance or anything.

Google has been unhelpful in turning up solutions to this problem, because most of the results I have found were just other people asking the same or a similar question, and then either no answer, or something I had already tried, with no indication of exactly what sort of options or settings I needed to give it in order to accomplish the task.

I am using the processing.core.jar from version 2.0b7, but I don't think that would make a difference, although I plan to try it with different versions if I can't figure out anything else.

A copy of my project folder can be found at https://www.dropbox.com/sh/1n4curhxbgi8fye/A5F6_l7xQu

All the data I have is stuff I've concatenated together from successive versions of the file at http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M1.txt

解决方案

I've done a quick test on OSX and had to tweak your eclipse project a bit:

  1. You are linking to .jar libraries using absolute path. I recommend using keeping libraries relative to the project
  2. I ran into some memory issues and had to add a couple of compiler flags
  3. Added a main method in Earthquaker.java to initialize as an application.

main looks like this:

public static void main(String[] args) {
        PApplet.main(Earthquaker.class.getSimpleName());
    }

In eclipse you can export a runnable jar via File > Export > Java > Runnable JAR file. Here are a couple of screenshots:

Personally I prefer using the "Copy required libraries into a sub-folder..." option in case I need to update some dependent .jar independent of the main application .jar.

For reference I've uploaded the modified eclipse project here(Java SDK will need to be changed). The exported runnable jar with a bash script is available here.

And here is the bash script itself which should run on Linux as well:

java -Xms128M -Xmx1024M -jar Processing-DataVisualization.jar

Pretty cool project btw.

这篇关于如何让我的程序运行在eclipse之外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆