我在尝试使用代码时正在解析异常
String date="Sat Jun 01 12:53:10 IST 2013";
SimpleDateFormat sdf=new SimpleDateFormat("MMM d, yyyy HH:mm:ss");
Date currentdate;
currentdate=sdf.parse(date);
System.out.println(currentdate);
Run Code Online (Sandbox Code Playgroud)
例外
String date="Sat Jun 01 12:53:10 IST 2013";
SimpleDateFormat sdf=new SimpleDateFormat("MMM d, yyyy HH:mm:ss");
Date currentdate;
currentdate=sdf.parse(date);
System.out.println(currentdate);
Run Code Online (Sandbox Code Playgroud)
输入:Sat Jun 01 12:53:10 IST 2013
预期产量:Jun 01,2013 12:53:10
怎么解决这个?
我已经为java项目编写了nsis脚本.我的项目中有批处理文件.我已经为常用的Windows 32位和64位编写了批处理文件.安装完成后,我已经使用Exec命令自动启动了批处理文件.它在32位windows中运行良好.但是同时这在64位中运行不佳.所以我怀疑在安装之前我应该检查一下Windows是32位还是64位版本.请分享您的看法如何检查?
我们如何从谷歌电子表格中的单元格中获取价值?
我有行和列索引 ROW() and COLUMN() - 1.
换句话说,另一种方法是做什么"= B1"我的行为1,列为2.
任何建议,单个电子表格查询.除了向电子表格添加功能.
我正在尝试为JMX Connector设置请求超时,但似乎它不起作用.
env.put("jmx.remote.x.request.waiting.timeout", new Long(30000));
Run Code Online (Sandbox Code Playgroud)
但由于它不起作用,我用谷歌搜索原因并发现在标准的JMX远程api中不支持上述环境变量.
有没有其他方法来设置请求超时?
我在我的项目中编写了Rest Web服务.Web服务调用可能来自不同的机器.所以我需要通过REST webservice找出IP地址.
从这个链接 request.getRemoteAddr()来使用它.
但我不能使用getRemoteAddr().因为我的请求和响应是xml格式.
我在REST服务中使用了post方法.Tomcat服务器.我有以xml格式发送请求.
我怎样才能获得IP地址?
我写了简单的java程序:
package bsh;
import test.Testclass;
public class Whatever {
public static void main(String args[]){
Testclass t = new Testclass();
System.out.println(t.squareIt(8));
}
}
Run Code Online (Sandbox Code Playgroud)
package test;
public class Testclass {
public Testclass(){
}
public int squareIt(int i){
return i*i;
}
}
Run Code Online (Sandbox Code Playgroud)
我有两个关于这个java程序的问题:
我怎样才能实现这一目标?
我是 JMS(java 消息服务)的新手。我想使用 jboss 6 运行示例 JMS 应用程序。
我已经厌倦了谷歌搜索,并得到了像这样。这些链接是指 jboss 7。
1.如何在jboss 6中配置JMS?
2.Jboss7有内置JMS吗?还是需要手动配置?
3.使用Jboss 6的示例应用程序?
对不起,如果我的问题很愚蠢或无关紧要.但我只是想知道在这两种情况下会发生什么.
public class Test {
public static void main(String[] args)
{
String str="test";
if(str.equals("test")){
System.out.println("After");
}
if("test".equals(str)){
System.out.println("Before");
}
}
}
Run Code Online (Sandbox Code Playgroud)
两者都只给出相同的结果.但我知道有一些原因.我不知道.这两个条件有什么区别?
我是launch4j的新手.我想用launch4j创建exe文件.我已经关注了lauch4j教程的这个链接.现在,我想使用launch4j在命令行中创建exe文件?我尝试过以下命令,但它不起作用.
>launch4j.exe sample.jar
Run Code Online (Sandbox Code Playgroud) 我已经下载了activemq版本5.8.0并编写了用于创建队列的示例程序.我成功地向队列发送了一条示例消息.
之后,我尝试将消息ID设置为特定消息.消息ID可用于检索特定消息.我试图使用设置消息ID message.setJMSMessageID("1234");.
public static void messagestoQueueu(){
// JMS messages are sent and received using a Session. We will
// create here a non-transactional session object. If you want
// to use transactions you should set the first parameter to 'true'
Session session;
try {
// Getting JMS connection from the server and starting it
ConnectionFactory connectionFactory =
new ActiveMQConnectionFactory(url);
Connection connection = connectionFactory.createConnection();
connection.start();
session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
// Destination represents here our queue 'TESTQUEUE' on the
// …Run Code Online (Sandbox Code Playgroud) page custom test
# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
MessageBox MB_OK "done"
;............
;.........
SectionEnd
Function test
MessageBox MB_OK "ok"
//Do some stuff
FunctionEnd
# Installer functions
Function .onInit
!ifdef IsSilent
SetSilent silent
!endif
InitPluginsDir
FunctionEnd
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,以静默和非静默模式两种方式运行。如果在非静默模式 [用户交互] 下运行它,则会调用自定义页面函数并显示 msg 框。但是,如果您在静默模式下运行它[无用户交互],则不会调用自定义页面,也不会显示 msg 框。此外,完成消息框以静默模式显示。
是否有任何原因未在静默安装程序中调用自定义页面?
如何在静默安装程序模式下调用自定义页面?