How to install Java 8 on Mac

I want to do some programming with the latest JavaFX, which requires Java 8. I'm using IntelliJ 13 CE and Mac OS X 9 Mavericks. I ran Oracle's Java 8 installer, and the files look like they ended up at /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk but previous versions are at /System/Library/Java/JavaFrameworks/jdk1.6.... Not sure why the latest installer puts this in /Library in

如何在Mac上安装Java 8

我想用最新的JavaFX进行编程,这需要Java 8.我使用IntelliJ 13 CE和Mac OS X 9 Mavericks。 我运行了Oracle的Java 8安装程序,并且这些文件看起来像是在最后 /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk 但以前的版本是 /System/Library/Java/JavaFrameworks/jdk1.6.... 不知道为什么最新的安装程序把它放在/Library而不是/System/Library (或者它们有什么区别)。 但是/usr/libexec/java_home没有找到1.8,所以

Debugging the init() method in a Java servlet

From what I know about how a Tomcat server works, is that if you have a Java servlet in your web application, the init() method is called whenever the server starts up. In that case, how can I debug the init() method? Putting a break point clearly doesn't work, and for some reason System.out.println statements also do not yield any output on my server console. I have checked that the cor

调试Java servlet中的init()方法

从我所了解的Tomcat服务器的工作原理来看,如果您的Web应用程序中有一个Java Servlet,则只要服务器启动,就会调用init()方法。 在那种情况下,我该如何调试init()方法? 明确划出断点不起作用,由于某种原因, System.out.println语句也不会在我的服务器控制台上产生任何输出。 我检查了正确的Web应用程序( .war )已部署,并在我的Tomcat服务器的webapps文件夹中正确提取。 在我看来,像你的部署描述符servlet声明没有

java.lang.ClassNotFoundException for servlet in tomcat with eclipse

This question already has an answer here: Servlet returns “HTTP Status 404 The requested resource (/servlet) is not available” 1 answer Sometimes on creating of filters or servlets, the class file is not generated in build folder in eclipse.Clean the application and build it once, a .class file is generated in that above said path. This removes class not found error in some cases. it is a

用于eclipse的tomcat中的servlet的java.lang.ClassNotFoundException

这个问题在这里已经有了答案: Servlet返回“HTTP状态404请求的资源(/ servlet)不可用”1答案 有时在创建过滤器或servlet时,类文件不会在eclipse中的build文件夹中生成。清理应用程序并构建一次,会在上述路径中生成一个.class文件。 这在某些情况下删除类未找到错误。 这是一个maven项目? 在maven项目中,src / test是单元测试的位置,不包含构建和战争,请尝试更改包名并重试。 看起来你正在构建一个基于Maven的项

Sending Email in Android using JavaMail API without using the default/built

I am trying to create a mail sending application in Android. If I use: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); This will launch the built-in Android application; I'm trying to send the mail on button click directly without using this application. Send e-mail in Android using the JavaMail API using Gmail authentication Steps to create a sample Project: M

使用JavaMail API在Android中发送电子邮件,而不使用默认/构建

我正在尝试在Android中创建邮件发送应用程序。 如果我使用: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 这将启动内置的Android应用程序; 我试图直接发送按钮上的邮件, 而不使用此应用程序。 使用Gmail身份验证使用JavaMail API在Android中发送电子邮件 创建示例项目的步骤: MailSenderActivity.java YOUR PACKAGE; import android.app.Activity; import android.os.Bundle; import a

Issue downloading report exported to PPTX when deployed on server

We are generating our reports using JasperReports 5.6.1, and allow exporting the same template to PDF or Powerpoint. When running locally, the PDF and PPTX file downloaded work perfectly. When we deploy to our servers PDF works fine, but PPTX files cannot be opened. When we run locally, it is deployed to tomcat, but when deployed to the server it is running on Websphere. Things I tried and n

在服务器上部署时,发布导出到PPTX的下载报告

我们使用JasperReports 5.6.1生成我们的报告,并允许将相同的模板导出为PDF或Powerpoint。 在本地运行时,PDF和PPTX文件下载完美。 当我们部署到我们的服务器时,PDF工作正常,但无法打开PPTX文件。 当我们在本地运行时,它被部署到tomcat,但是当部署到服务器时,它将在Websphere上运行。 我试过并注意到的事情: 我已经检查过日志,没有任何异常或任何可以引起任何异议的地方。 下载的文件通常比我们在本地运行时获得

How to remove elements from a queue in Java with a loop

I have a data structure like this: BlockingQueue mailbox = new LinkedBlockingQueue(); I'm trying to do this: for(Mail mail: mailbox) { if(badNews(mail)) { mailbox.remove(mail); } } Obviously the contents of the loop interfere with the bounds and a error is triggered, so I would normally do this: for(int i = 0; i < mailbox.size(); i++) { if(badNews(mailbox.ge

如何使用循环从Java中的队列中删除元素

我有这样的数据结构: BlockingQueue mailbox = new LinkedBlockingQueue(); 我正在尝试这样做: for(Mail mail: mailbox) { if(badNews(mail)) { mailbox.remove(mail); } } 很明显,循环的内容会干扰边界并引发错误,所以我通常会这样做: for(int i = 0; i < mailbox.size(); i++) { if(badNews(mailbox.get(i))) { mailbox.remove(i); i--; } } 但令人遗憾的

Why are my null checks so slow?

So I have code that currently looks like this public boolean in(TransactionType... types) { if (types == null || types.length == 0) return false; for (int i = 0; i < types.length; ++i) if (types[i] != null && types[i] == this) return true; return false; } I changed it to this public boolean in(Transacti

为什么我的空检查很慢?

所以我有目前看起来像这样的代码 public boolean in(TransactionType... types) { if (types == null || types.length == 0) return false; for (int i = 0; i < types.length; ++i) if (types[i] != null && types[i] == this) return true; return false; } 我改变了这一点 public boolean in(TransactionType... types)

spring boot remote shell custom command

I try to add a new custom command to the spring boot remote shell without success. In the documentation is only a groovy example available but I like to use Java do create a new command. http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-remote-shell.html I also check the CRaSH documentation: http://www.crashub.org/1.3/reference.html#_java_commands I put my class

弹簧启动远程shell自定义命令

我尝试将新的自定义命令添加到spring引导远程shell中,但未成功。 在文档中只是一个可用的例子,但我喜欢使用Java创建一个新的命令。 http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-remote-shell.html我也检查了CRaSH文档:http://www.crashub.org/1.3/ #的reference.html _java_commands 我把我的类放在包命令和crash.commands下,但是如果我通过ssh连接到shell并键入help,则看不到

How to properly read POST request body in a Handler?

The code I'm using now: Pooled<ByteBuffer> pooledByteBuffer = exchange.getConnection().getBufferPool().allocate(); ByteBuffer byteBuffer = pooledByteBuffer.getResource(); int limit = byteBuffer.limit(); byteBuffer.clear(); exchange.getRequestChannel().read(byteBuffer); int pos = byteBuffer.position(); byteBuffer.rewind(); byte[] bytes = new byte[pos];

如何在Handler中正确读取POST请求体?

我现在使用的代码是: Pooled<ByteBuffer> pooledByteBuffer = exchange.getConnection().getBufferPool().allocate(); ByteBuffer byteBuffer = pooledByteBuffer.getResource(); int limit = byteBuffer.limit(); byteBuffer.clear(); exchange.getRequestChannel().read(byteBuffer); int pos = byteBuffer.position(); byteBuffer.rewind(); byte[] bytes = new byte[pos]; by

Does Akka's event bus guarantee message order?

I would like to keep the order the events entered the bus. For example if event1 then event2 where entered to the bus then a subscribed actor would get them in that order. The question is if such order is guarantee, both on clustered and on single node actor system. If you are using the event stream on the actor system ( system.eventStream ) and if you can guarantee a single thread is publis

Akka的活动巴士是否可以保证消息顺序?

我想保留事件进入公共汽车的顺序。 例如,如果事件1然后是进入公共汽车的事件2,则订阅的演员将按照该顺序获取它们。 问题在于,如果这样的顺序是保证的,无论是在集群系统上还是在单节点角色系统上。 如果您在actor系统( system.eventStream )上使用事件流,并且您可以保证发布单个线程,那么是的,订单将被保留。 事件总线的子通道分类风格(与system.eventStream相关的类型)非常简单。 有一个基本上是类类型的Map到