如何将 .jar 文件转换为 .ipa 文件?

发布于 2024-12-28 07:36:57 字数 1148 浏览 4 评论 0原文

我最近制作了一个简单的 .jar 文件,名为“circle.jar”。它所做的只是在屏幕上绘制一个绿色圆圈。该文件的代码如下:

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;    
public class CircleDraw extends Frame {
    float x;
    Shape circle = new Ellipse2D.Float(110.0f, 40.0f, 100.0f, 100.0f);
    public void paint(Graphics g) {
    Graphics2D ga = (Graphics2D)g;
    ga.setColor(Color.green);
    ga.draw(circle);  
    ga.setPaint(Color.green);
    ga.fill(circle);
}
public static void main(String args[]) {
    Frame frame = new CircleDraw();
    frame.addWindowListener(new WindowAdapter(){
        public void windowClosing(WindowEvent we){
            System.exit(0);
      }
    });
    frame.setSize(320, 480);
    frame.setVisible(true);
  }
}

现在,我想知道是否可以以某种方式将其转换/编译为我的 iPod touch 的 .ipa 文件。我有一台已越狱的第四代 iPod touch。 另外,如果这是不可能的,那么我正在考虑是否可以将 .java 或 .class 文件编译为 Objective-C 文件。我听说过 XMLVM,但要成功使用它,您需要安装了 Cocoa 库。但是,我使用的是 Windows 7 电脑,据我所知,Cocoa 库无法在电脑上下载。 (但是,如果是告诉我!) 我还意识到确切的代码可能无法针对 iPod touch 进​​行编译,但这并不重要。该代码仅作为示例给出。 任何帮助都非常感谢! :)

I recently made a simple .jar file called "circle.jar". All it does is draw a green circle to the screen. The code to the file is below:

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;    
public class CircleDraw extends Frame {
    float x;
    Shape circle = new Ellipse2D.Float(110.0f, 40.0f, 100.0f, 100.0f);
    public void paint(Graphics g) {
    Graphics2D ga = (Graphics2D)g;
    ga.setColor(Color.green);
    ga.draw(circle);  
    ga.setPaint(Color.green);
    ga.fill(circle);
}
public static void main(String args[]) {
    Frame frame = new CircleDraw();
    frame.addWindowListener(new WindowAdapter(){
        public void windowClosing(WindowEvent we){
            System.exit(0);
      }
    });
    frame.setSize(320, 480);
    frame.setVisible(true);
  }
}

Now, I was wondering if I could somehow convert/compile this to a .ipa file for my iPod touch. I have a 4th generation jailbroken iPod touch.
Also, if this is not possible, then I was pondering whether or not I could compile the .java or the .class file to an Objective-C file. I have heard of XMLVM, but to successfully use it you would need to have the Cocoa Library installed. However, I am using a PC with Windows 7 and as far as I know, the Cocoa Library is not available for download on a PC. (However, if it is please let me know!)
I also realize that the exact code may not be able to compile for the iPod touch, but that doesn't matter. The code was just given as a sample.
Any help is greatly appreciated!
:)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

兔姬 2025-01-04 07:36:57

最简单的方法可能是在 Objective-C 中编写相同的代码并使用 iOS 开发工具链,将其安装到您的 iPod Touch 上。

The easiest way is probably to just write that same code in Objective-C and use the iOS development toolchain to get it on your iPod Touch.

人疚 2025-01-04 07:36:57

Your best platforms for cross-platform development are listed on Wikipedia.

情话已封尘 2025-01-04 07:36:57

有一些工具可以实现此目的,但它们要求您拥有 Mac 以及 99 美元的开发许可证。

例如:Titanium

如果您的 iPhone 已越狱,则不需要开发人员许可证,那么您可以将 .ipa 添加到呼吸站,然后从 Cydia 等下载它。
不过,你仍然需要一台 Mac。

There are some tools for this, but they require you to have a Mac together with a developing licence for 99$.

For example: Titanium

You wouldn't need a developer license if your iPhone is jailbreaked though, then you could just add the .ipa to a respitory and then download it from for example Cydia.
You'll still need a Mac, though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文