关于splashjava的信息
本篇文章给大家谈谈splashjava,以及对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
java如何打包
建议使用ANT打包工具,下载地址:
此工具用java编写,跨平台,能实现很多功能:编译、打包、运行、文件操作、数据库操作、自定义任务等。
主要使用方法:在工程目录下编写build.xml配置文件,然后运行ant即可:
#ant
或
#java -jar ant.jar
下面给你提供一个例子,是jakarta-oro-2.0.8的包的build.xml
?xml version="1.0"?
project default="jar"
!-- Allow properties following these statements to be overridden --
!-- Note that all of these don't have to exist. They've just been defined
incase they are used. --
property file="build.properties"/
!--
property file=".ant.properties"/
property file="${user.home}/.ant.properties"/
property file="default.properties"/
--
!-- prepare target. Creates build directories. --
target name="splash"
splash imageurl="./ant_logo_medium.gif"/
/target
target name="prepare" depends="splash" description="Creates build directories."
tstamp
format property="DATE" pattern="yyyy-MM-dd hh:mm:ss" /
/tstamp
mkdir dir="${build.dest}"/
mkdir dir="${build.dest}/META-INF"/
copy todir="${build.dest}/META-INF"
fileset dir="${top.dir}"
include name="LICENSE"/
/fileset
/copy
mkdir dir="${build.tests}"/
available file="${jakarta-site2.dir}/lib" type="dir"
property="AnakiaTask.present"/
/target
target name="prepare-error" depends="prepare"
description="Prints error message for prepare target."
unless="AnakiaTask.present"
echo
AnakiaTask is not present! Please check to make sure that
velocity.jar is in your classpath.
/echo
/target
!-- lib target. Compiles the library classes only --
target name="lib" depends="prepare"
description="Compiles the library classes only."
javac srcdir="${build.src}"
destdir="${build.dest}"
excludes="examples/**,tools/**"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/
/target
!-- examples target. Compiles the example classes. --
target name="examples" depends="prepare,lib"
description="Compiles the example classes."
javac srcdir="${build.src}"
destdir="${build.dest}"
includes="examples/**"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/
/target
!-- tools target. Compiles the tool classes. --
target name="tools" depends="prepare,lib"
description="Compiles the tool classes."
javac srcdir="${build.src}"
destdir="${build.dest}"
includes="tools/**"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/
/target
!-- tests target. Compiles and runs the unit tests. --
target name="tests" depends="prepare,lib"
description="Compiles and runs the unit tests."
javac srcdir="${build.src}/tests"
destdir="${build.tests}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/
/target
!-- jar target. Compiles the source directory and creates a .jar file --
target name="jar" depends="lib" description="Compiles the source directory and creates a .jar file."
jar jarfile="${top.dir}/${final.name}.jar"
basedir="${build.dest}"
includes="org/**,META-INF/**"
excludes="**/package.html,**/overview.html"
manifest
section name="org/apache/oro"
attribute name="Specification-Title"
value="Jakarta ORO" /
attribute name="Specification-Version"
value="${version}" /
attribute name="Specification-Vendor"
value="Apache Software Foundation" /
attribute name="Implementation-Title"
value="org.apache.oro" /
attribute name="Implementation-Version"
value="${version} ${DATE}" /
attribute name="Implementation-Vendor"
value="Apache Software Foundation" /
/section
/manifest
/jar
/target
!-- javadocs target. Creates the API documentation --
target name="javadocs" depends="prepare"
description="Creates the API documentation."
mkdir dir="${javadoc.destdir}"/
javadoc packagenames="org.apache.oro.io,org.apache.oro.text,org.apache.oro.text.regex,org.apache.oro.text.awk,org.apache.oro.text.perl,org.apache.oro.util"
sourcepath="${build.src}"
destdir="${javadoc.destdir}"
overview="${build.src}/org/apache/oro/overview.html"
author="true"
version="true"
windowtitle="${name} ${version} API"
doctitle="${name} ${version} API"
header="a href='' target=_topimg src='{@docroot}/../images/logoSmall.gif' alt='Jakarta ORO' width=48 height=47 align=center border=0 hspace=1 vspace=1/a"
bottom="Copyright © ${year} Apache Software Foundation. All Rights Reserved."
/javadoc
replace file="${javadoc.destdir}/overview-frame.html"
token="{@docroot}" value="."/
replace dir="${javadoc.destdir}" includes="**/*.html"
token="@version@" value="${version}"/
/target
!-- docs target. Creates project web pages and documentation. --
target name="docs" depends="prepare-error,lib,examples"
description="Creates the project web pages and documentation."
if="AnakiaTask.present"
taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask"
classpath
fileset dir="${jakarta-site2.dir}/lib"
include name="*.jar"/
/fileset
/classpath
/taskdef
anakia basedir="${docs.src}" destdir="${docs.dest}/"
extension=".html" style="./site.vsl"
projectFile="stylesheets/project.xml"
excludes="**/stylesheets/** manual/** empty.xml"
includes="**/*.xml"
lastModifiedCheck="true"
templatePath="${jakarta-site2.dir}/xdocs/stylesheets"
/anakia
copy todir="${docs.dest}/images" filtering="no"
fileset dir="${docs.src}/images"
include name="**/*.gif"/
include name="**/*.jpeg"/
include name="**/*.jpg"/
/fileset
/copy
mkdir dir="${docs.dest}/classes"/
mkdir dir="${docs.dest}/classes/examples"/
copy todir="${docs.dest}/classes/examples" filtering="no"
fileset dir="${build.dest}/examples"
include name="MatcherDemoApplet.class"/
/fileset
/copy
mkdir dir="${docs.dest}/classes/org"/
copy todir="${docs.dest}/classes/org" filtering="no"
fileset dir="${build.dest}/org"
include name="**/*.class"/
/fileset
/copy
/target
!-- package target --
target name="package" depends="jar,javadocs,docs"
description="Creates a distribution directory tree."
mkdir dir="${final.dir}"/
copy todir="${final.dir}/src"
fileset dir="${code.src}"/
/copy
!-- BEGIN_REMOVE_THIS --
!-- Remove this when there's a first draft of the manual. --
copy todir="${final.dir}/docs"
fileset dir="${docs.dest}"
exclude name="manual/**"/
/fileset
/copy
!-- END_REMOVE_THIS --
copy file="${top.dir}/build.xml" tofile="${final.dir}/build.xml"/
copy file="${top.dir}/build.properties"
tofile="${final.dir}/build.properties"/
copy file="${top.dir}/LICENSE" tofile="${final.dir}/LICENSE"/
copy file="${top.dir}/ISSUES" tofile="${final.dir}/ISSUES"/
copy file="${top.dir}/CHANGES" tofile="${final.dir}/CHANGES"/
copy file="${top.dir}/COMPILE" tofile="${final.dir}/COMPILE"/
copy file="${top.dir}/CONTRIBUTORS"
tofile="${final.dir}/CONTRIBUTORS"/
copy file="${top.dir}/README" tofile="${final.dir}/README"/
copy file="${top.dir}/STYLE" tofile="${final.dir}/STYLE"/
copy file="${top.dir}/TODO" tofile="${final.dir}/TODO"/
copy file="${top.dir}/${final.name}.jar" tofile="${final.dir}/${final.name}.jar"/
/target
!-- package-zip target. Packages the distribution with ZIP --
target name="package-zip" depends="package"
description="Packages the distribution as a zip file."
zip zipfile="${top.dir}/${final.name}.zip" basedir="${top.dir}/"
includes="**/${final.name}/**" excludes="**/.cvsignore"/
/target
!-- Packages the distribution with TAR-GZIP --
target name="package-tgz" depends="package"
description="Packages the distribution as a gzipped tar file."
tar tarfile="${top.dir}/${final.name}.tar"
basedir="${top.dir}" excludes="**/**"
tarfileset dir="${final.dir}/.."
include name="${final.name}/**"/
exclude name="**/.cvsignore"/
/tarfileset
/tar
gzip zipfile="${top.dir}/${project}-${version}.tar.gz" src="${top.dir}/${project}-${version}.tar"/
/target
!-- Packages the distribution with ZIP and TAG-GZIP --
target name="package-all" depends="package-zip, package-tgz"
/target
!-- Makes an attempt to clean up a little. --
target name="clean"
description="Removes generated artifacts from source tree."
delete dir="${build.dest}"/
delete dir="${javadoc.destdir}"/
delete dir="${final.dir}"/
delete file="${top.dir}/${final.name}.jar"/
delete file="${top.dir}/${final.name}.tar"/
delete file="${top.dir}/${final.name}.tar.gz"/
delete file="${top.dir}/${final.name}.zip"/
delete
fileset dir="${top.dir}" includes="velocity.log*"/
/delete
/target
/project
build.xml文件的编写可参见ant发行版中的使用文档
你也可以自己编写脚本打包,使用jdk发行版中的jar命令,例如:
#jar cmf myManifestFile myFile.jar *.class
注意还需要自己编写MANIFEST.MF文件配置包属性。具体可以参见javadoc
当然还可以使用集成开发环境提供的打包工具,如JBuilder提供打包工具,但这样程序的移植性不强,建议不要使用,就使用ant比较好。
java SplashScreen类问题
可以使用jdk6.0中的 -splash选项直接指定一副图片作为闪屏,格式为:java -splash:splash图片文件的路径 Mainclass文件
如果要交互可以参考
怎么检验java是否安装成功
xp下:开始——运行——cmd 确定——java 回车——C:\Documents and Settings\Administratorjava
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp class search path of directories and zip/jar files
-classpath class search path of directories and zip/jar fil
A ; separated list of directories, JAR archive
and ZIP archives to search for class files.
-Dname=value
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:value
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the versi
-? -help print this help message
-X print help on non-standard options
-ea[:packagename...|:classname]
-enableassertions[:packagename...|:classname]
enable assertions
-da[:packagename...|:classname]
-disableassertions[:packagename...|:classname]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:libname[=options]
load native agent library libname, e.g. -age
see also, -agentlib:jdwp=help and -agentlib:
-agentpath:pathname[=options]
load native agent library by full pathname
-javaagent:jarpath[=options]
load Java programming language agent, see java
-splash:imagepath
show splash screen with specified image
javac 回车——C:\Documents and Settings\Administratorjavac
用法:javac 选项 源文件
其中,可能的选项包括:
-g 生成所有调试信息
-g:none 不生成任何调试信息
-g:{lines,vars,source} 只生成某些调试信息
-nowarn 不生成任何警告
-verbose 输出有关编译器正在执行的操作的消息
-deprecation 输出使用已过时的 API 的源位置
-classpath 路径 指定查找用户类文件和注释处理程序的
-cp 路径 指定查找用户类文件和注释处理程序的
-sourcepath 路径 指定查找输入源文件的位置
-bootclasspath 路径 覆盖引导类文件的位置
-extdirs 目录 覆盖安装的扩展目录的位置
-endorseddirs 目录 覆盖签名的标准路径的位置
-proc:{none,only} 控制是否执行注释处理和/或编译。
-processor class1[,class2,class3...]要运行的注释处理程序
的搜索进程
-processorpath 路径 指定查找注释处理程序的位置
-d 目录 指定存放生成的类文件的位置
-s 目录 指定存放生成的源文件的位置
-implicit:{none,class} 指定是否为隐式引用文件生成类文件
-encoding 编码 指定源文件使用的字符编码
-source 版本 提供与指定版本的源兼容性
-target 版本 生成特定 VM 版本的类文件
-version 版本信息
-help 输出标准选项的提要
-Akey[=value] 传递给注释处理程序的选项
-X 输出非标准选项的提要
-J标志 直接将 标志 传递给运行时系统
如果是这样的结果,说明你的Jdk安装成功了。大部分不成功的原因在于环境变量的配置不正确,所以一定要仔细设置环境变量的值。
没有更改路径安装的JDK,设置环境变量的值是这样的:
ClassPath .;C:\Program Files\Java\jdk1.6.0_24\lib\toos.jar;C:\Program Files\Java\jdk1.6.0_24\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_24\bin
Path C:\Program Files\Java\jdk1.6.0_24\bin;
java添加一个欢迎页面
一本电子书上说的,你可以试下
1、新建一个启动画面Window类
java.awt.Window windowSplash;
2、调用prepareSplash()函数,初始化启动界面
private void prepareSplash()
{
Toolkit toolkit = Toolkit.getDefaultToolkit();
windowSplash = new Window( this );
Image image = toolkit.getImage( "images" + File.separator + "splash.gif" );
ImageCanvas canvas = new ImageCanvas( image );
windowSplash.add( canvas, "Center" );
Dimension scmSize = toolkit.getScreenSize();
int imgWidth = image.getWidth( this );
int imgHeight = image.getHeight( this );
windowSplash.setLocation( scmSize.width/2 - (imgWidth/2), scmSize.height/2 - (imgHeight/2) );
windowSplash.setSize( imgWidth, imgHeight );
}
3、在Application的JFrame类(主界面)中调用startSplash(),显示启动界面,然后初试化JFrame的各个可视化组件,初始化后台数据库等(如数据
库的连接)
private void startSplash()
{
windowSplash.setVisible( true );
windowSplash.toFront();
}
4、在所有的初始化工作完成之后,调用stopSplash()函数,停止显示启动画面
private void stopSplash()
{
windowSplash.dispose();
}
请详细写出Javac和Java两个命令的使用方式
javaac和java两个命令的使用详解:
一、javac命令
javac 用于编译Java文件,格式为:
java [options] [sourcefiles] [@files]
其中:
options:命令行选项;
sourcefiles:一个或多个要编译的源文件;
@files:一个或多个对源文件进行列表的文件,有时候要编译的文件很多,一个个敲命令会显得很长,也不方便修改,可以把要编译的源文件列在文件中,在文件名前加@,这样就可以对多个文件进行编译,对编译一个工程很有用,方便,省事。
有几个比较重要的选项:
-d 用于指定编译成的class文件的存放位置,缺省情况下不指定class文件的存放目录,编译的class文件将和源文件在同一目录下;
-classpath 可以简写成-cp,用于搜索编译所需的class文件,指出编译所用到的class文件的位置,如jar、zip或者其他包含class文件的目录,指定该选项会覆盖CLASSPATH的设定;
-sourcepath用于搜索编译所需的源文件(即java文件),指定要搜索的源文件的位置,如jar、zip或其他包含java文件的目录;
需要注意windows下和linux下文件路径分隔符和文件列表(即-classpath和-sourcepath指定的文件)分隔符的区别:
windows下文件路径分隔符用 \ ,文件列表分隔符用分号 ;
linux下文件路径分隔符用 / ,文件列表分隔符用冒号 :
二、java命令
java 用于执行程序,格式如下:
java [options] classfile
options:命令行选项,一般用于 -classpath 指定要执行的文件所在的位置以及需要用到的类路径,包括jar、zip和class文件目录,会覆盖CLASSPATH的设定
三、脚本
如果要敲的命令很长,每次要编译运行的时候都要重新敲一遍,这是一件很痛苦的事情,所以用脚本可以大大方便你的工作量。在linux下用shell脚本,windows下用bat批处理程序。因为是在linux下,我这里只是简单介绍一下shell,关于bat批处理程序的语法自己百度一下,不难。
1. 开头
linux有很多不同的shell,通常使用bash(bourne again shell),程序必须以下面的行开始:
#!/bin/sh
#!用来告诉系统用后面的参数来执行程序,这里使用的是/bin/sh
要使你的脚本能够执行,还必须让这个文件有可执行权限,使用下面命令更改文件权限:
chmod +x filename
2. 注释
以#开始的句子表示注释,一直到这行结束,多写注释有利于以后重新看的时候知道自己在做什么
关于splashjava和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
发布于:2022-12-03,除非注明,否则均为
原创文章,转载请注明出处。