根据https://wiki.archlinux.org/index.php/Java,我可以通过调用命令在干净的Arch Linux安装上安装Open JDK 7
pacman -S jdk7-openjdk
Run Code Online (Sandbox Code Playgroud)
但是当这样做时,我得到一个错误说
error: target not found: jdk7-openjdk
Run Code Online (Sandbox Code Playgroud)
我已经注释掉了我最近的Pacman存储库/etc/pacman.d/mirrorlist并通过调用pacman -Syu进行了第一次更新,希望这会导致上面的包被发现.
如何使用pacman在Arch Linux上安装Open JDK 7?
编辑:我正在运行带有ARM处理器的Raspberry Pi,我希望得到一个针对其硬件定制的Java构建,并使用OS硬件浮点支持.
我有一个由 JHipster 生成的 Angular 应用程序。默认情况下,它在根/url上运行,并重定向到/#/. 有没有办法将其覆盖为其他内容?
编辑
抱歉,我必须重新表述我的问题,因为它在下面的所有答案中都被误解了。我希望的土地上比其他的东西我JHipster生成角的应用/,如/crud/。目的是在/. 如何将整个应用程序从 移动/到/crud/?并且仍然/由静态index.html文件提供服务?
我想从Scala代码中调用一些Java代码.我想使用Scala的apply构造,所以我可以像这样调用它:
val led = OutPin(0)
Run Code Online (Sandbox Code Playgroud)
代替:
val led = new OutPin(0)
Run Code Online (Sandbox Code Playgroud)
我天真地在我的Java代码中实现了一个额外的apply方法,如下所示:
public class OutPin {
public OutPin(int pinNumber) {
}
public OutPin apply(int pinNumber) {
return new OutPin(pinNumber);
}
}
Run Code Online (Sandbox Code Playgroud)
这不会使我的Scala代码(上面的第一行)编译,而是给我一个错误:
对象OutPin不是值
在Java中实现Scala的apply方法的正确方法是什么?
我有一个actor FooActor被传递Props来实例化几个BarActors并发BarMessage送给它.代码有效,但我很难为它编写测试.增加的限制是我只能在这个应用程序中使用Java代码,没有Scala代码.
经过多次尝试,这似乎是我迄今为止的最大努力:
@Test
public void testJavaTestKit() {
new JavaTestKit(system) {{
JavaTestKit probe = new JavaTestKit(system);
// pretending that the probe is the receiving Bar, by returning it in the Props
Props barActorProps = Props.create(BarActor.class, new Creator() {
@Override
public Object create() {
return probe.getRef();
}
});
Props props = Props.create(FooActor.class, barActorProps);
ActorRef subject = system.actorOf(props);
Object msg = // basically irrelevant, will trigger Bar instantiation and message sending
subject.tell(msg, probe.getRef());
expectMsgClass(Bar.BarMessage.class);
expectNoMsg(); …Run Code Online (Sandbox Code Playgroud) 很像这个问题,但在这里我确实关心分叉和历史。
我从头开始重新启动一个项目,现在我想将它作为提交附加到现有的 git 存储库。我怎样才能做到这一点?
我正在尝试使用Apache CXF开发API调用,该调用接收附件以及请求.我遵循了这个教程,这是我到目前为止所得到的.
@POST
@Path("/upload")
@RequireAuthentication(false)
public Response uploadWadl(MultipartBody multipartBody){
List<Attachment> attachments = multipartBody.getAllAttachments();
DataHandler dataHandler = attachments.get(0).getDataHandler();
try {
InputStream is = dataHandler.getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
return Response("OK");
}
Run Code Online (Sandbox Code Playgroud)
我正在获取附件的InputStream对象,一切正常.但是,我需要将附件作为java.io.File对象传递给另一个函数.我知道我可以在这里创建一个文件,从输入流中读取并写入它.但是有更好的解决方案吗?CXF是否已将其存储为文件?如果是这样,我可以继续使用它.有什么建议?
有人可以提供使用Selenium IDE处理文件上传过程的想法或网站参考吗?
其余的行动是通过'Selenium IDE录制的,但这个上传过程单独给人带来麻烦......
谢谢Karunagara Pandi
当我尝试使用Squeryl的Table.insert在PostgreSQL表中插入新记录时,它会触发此查询:
insert into "users" ("id", "email", "fullname") values (nextval('"s_users_id"'),?,?)
Run Code Online (Sandbox Code Playgroud)
这不起作用,因为我没有定义序列,而是将id列定义为"autoincrement":
CREATE TABLE Users (
id BIGSERIAL,
email varchar(255) NOT NULL,
fullname varchar(255),
PRIMARY KEY (id)
);
Run Code Online (Sandbox Code Playgroud)
我在另一个论坛上读到了一些关于这个问题的老帖子,我想知道现在的状态.我们不鼓励使用自动增量并定义序列吗?或者有一个简单的解决方法来使这个工作?
编辑:事实上我刚才看到自动增量本身创建了一个序列,但是在另一个名称下:users_id_seq有没有办法告诉Squeryl看这个名字,或者遵循PostgreSQL的约定?
java ×3
akka ×1
angular ×1
archlinux ×1
cxf ×1
file-upload ×1
git ×1
inputstream ×1
jhipster ×1
multipart ×1
postgresql ×1
scala ×1
selenium ×1
selenium-ide ×1
squeryl ×1