Eclipse: Как создать исполняемую банку с внешней банкой?

Я думаю, что нашел проблему, потому что предметы из flowpane были больше, чем они могли вписаться в окно. Я добавил flawpane в scrollpane, и проблема была решена.

override val root = borderpane {
    addClass(screen)
    top = toolbarLayout.root
    center = scrollpane {
        isFitToHeight = true
        isFitToWidth = true
        vbarPolicy = ScrollPane.ScrollBarPolicy.AS_NEEDED
        content = flowpane {
            vgap = 20.0
            hgap = 20.0
            padding = insets(20, 40, 20, 40)
            for (i in 0..15) {
                add(MobileAppGridItemLayout(i))
            }
        }
    }
}
47
задан 3 August 2011 в 16:01
поделиться

5 ответов

Можно сделать это запись декларации для Вашего банка . Взгляните на Путь к классу заголовок. Eclipse имеет опцию для выбора Вашей собственной декларации на экспорт.

альтернатива должна добавить зависимость к пути к классу в то время, когда Вы вызываете приложение:

win32: java.exe -cp app.jar;dependency.jar foo.MyMainClass
*nix:  java -cp app.jar:dependency.jar foo.MyMainClass
14
ответ дан McDowell 26 November 2019 в 19:49
поделиться

Как хорошая практика можно использовать скрипт Ant (Eclipse идет с ним) генерировать файл JAR. В этом JAR у Вас может быть весь зависимый, освобождает.

можно даже установить заголовок Пути к классу ДЕКЛАРАЦИИ для указания на файлы в файловой системе, это не хорошая практика все же.

Муравей пример сценария build.xml:

<project name="jar with libs" default="compile and build" basedir=".">
<!-- this is used at compile time -->
<path id="example-classpath">
    <pathelement location="${root-dir}" />
    <fileset dir="D:/LIC/xalan-j_2_7_1" includes="*.jar" />
</path>

<target name="compile and build">
    <!-- deletes previously created jar -->
    <delete file="test.jar" />

    <!-- compile your code and drop .class into "bin" directory -->
    <javac srcdir="${basedir}" destdir="bin" debug="true" deprecation="on">
        <!-- this is telling the compiler where are the dependencies -->
        <classpath refid="example-classpath" />
    </javac>

    <!-- copy the JARs that you need to "bin" directory  -->
    <copy todir="bin">
        <fileset dir="D:/LIC/xalan-j_2_7_1" includes="*.jar" />
    </copy>

    <!-- creates your jar with the contents inside "bin" (now with your .class and .jar dependencies) -->
    <jar destfile="test.jar" basedir="bin" duplicate="preserve">
        <manifest>
            <!-- Who is building this jar? -->
            <attribute name="Built-By" value="${user.name}" />
            <!-- Information about the program itself -->
            <attribute name="Implementation-Vendor" value="ACME inc." />
            <attribute name="Implementation-Title" value="GreatProduct" />
            <attribute name="Implementation-Version" value="1.0.0beta2" />
            <!-- this tells which class should run when executing your jar -->
            <attribute name="Main-class" value="ApplyXPath" />
        </manifest>
    </jar>
</target>

5
ответ дан Lucas Pottersky 26 November 2019 в 19:49
поделиться

Попробуйте расширение толстой банки. Это будет включать все внешние банки в банке.

2
ответ дан Marius 26 November 2019 в 19:49
поделиться
0
ответ дан 26 November 2019 в 19:49
поделиться

Eclipse 3.5 имеет возможность упаковать необходимые библиотеки в исполняемый jar. Файл -> Экспорт ... Выберите runnable jar и нажмите "Далее". Экспорт исполняемого jar-файла В окне есть переключатель, где вы можете упаковать необходимые библиотеки в jar.

36
ответ дан 26 November 2019 в 19:49
поделиться
Другие вопросы по тегам:

Похожие вопросы: