小编Tho*_*mas的帖子

缺少工件com.sun:工具:jar

我一直在关注入门教程,但在使用Maven导入playn项目后卡住了.我正在使用在64位Windows 7上运行的Eclipse Indigo.

所有导入的项目都有相同的错误:

Missing Artifact com.sun:tools:jar in all the pom.xml files.
Run Code Online (Sandbox Code Playgroud)

经过几个小时的搜索论坛,我尝试过:

安装最新的Java 1.6.029更改JAVA_HOME环境变量以指向\program files\Java\jdk1.6_029 更改Eclipse Java首选项以使用JRE jdk1.6_029.

我真的想尝试playn,但为什么有一些帖子我似乎无法找到解决方案的共识答案.有人说Sun从64位jdk中删除了一些东西,其他人说你必须编辑你的xml文件,很多人说你已经改变了你的JAVA_HOME,另一个人说你必须改变Eclipse的VM选项.

任何有关清除此功能的帮助都会受到赞赏,并且可能对许多人有用,因为我这里没有特别奇怪的设置.

(编辑)这是第一个项目中的pom.xml.Eclipse标记行中的错误:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.googlecode.playn</groupId>
    <artifactId>playn-project</artifactId>
    <version>1.1-SNAPSHOT</version>
  </parent>

  <artifactId>playn-android</artifactId>
  <name>PlayN Android</name>
  <packaging>jar</packaging>

  <repositories>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>com.googlecode.playn</groupId>
      <artifactId>playn-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- needed because Android uses the same JSON code as playn-java;
         that should be factored into a library shared by both backends -->
    <dependency>
      <groupId>com.googlecode.playn</groupId>
      <artifactId>playn-java</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency> …
Run Code Online (Sandbox Code Playgroud)

java maven playn

78
推荐指数
9
解决办法
16万
查看次数

android.content.res.Resources $ NotFoundException:字符串资源ID Main中的致命异常

我一直在尝试制作一个简单的程序,它取一个小的随机数并在textview中显示给用户.在最终获得随机数生成(我认为)后,程序会在我运行时抛出致命异常.代码没有错误,但我是一个完整的新手,我开始简单,以便我可以学习.几个小时后,我已经提交寻求帮助.我几乎可以肯定我的随机数字片段是在错误的区域,我只是不确定在哪里放.我尝试的每个地方都抛出同样的错误.

这是.java

package com.eai.vgp;

import java.util.Random;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;

    }


    Random pp = new Random();
int a1 = pp.nextInt(10);

TextView tv = (TextView)findViewById(R.id.tv);{

tv.setText(a1);}

    }
Run Code Online (Sandbox Code Playgroud)

XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<TextView
    android:id="@+id/tv" …
Run Code Online (Sandbox Code Playgroud)

random android exception textview

61
推荐指数
4
解决办法
9万
查看次数

如何使用PC键盘输入Android模拟器

我无法使用PC键盘输入模拟器.

谁能帮我 ?

android android-emulator

34
推荐指数
4
解决办法
2万
查看次数

如何将java swing应用程序转换为在android上运行

所以我使用swing为接口构建了一个Java程序,我没有意识到将它转换为用作Android应用程序是多么困难.有没有办法让我轻松转换或重建在Android市场上销售的程序?如果没有,任何人都可以指向我任何资源,以帮助建立一个Android.

java swing android

21
推荐指数
2
解决办法
5万
查看次数

如何在内置笔记本电脑蓝牙的VirtualBox上测试基于Androidx86的蓝牙应用程序

如何在笔记本电脑上的Android模拟器上运行基于蓝牙的应用程序.当我运行蓝牙应用程序时,据说蓝牙设备未连接.我用谷歌搜索,我找到了一种使用方法Oracle VM VirtualBox.我也按照这个步骤,

  1. http://www.android-x86.org/下载Androidx86 .这是一个.iso文件,所以你需要像VMWare或VirtualBox这样的东西来运行它.我,我使用VirtualBox.
  2. 创建虚拟机时,需要将来宾操作系统的类型设置为Linux而不是其他.
  3. 创建虚拟机后,将网络适配器设置为"Bridged".
  4. 启动VM并在启动时选择"Live CD VESA".
  5. 现在你需要找出这个VM的ip.转到VM中的终端(使用Alt + F1和Alt + F7切换)并使用netcfg命令查找.
  6. 现在您需要打开命令提示符并转到您的android安装文件夹(在主机上).这通常是C:\ Program Files\Android\android-sdk\platform-tools>.
  7. 输入adb connect IP_ADDRESS
  8. 完了!现在您需要添加蓝牙.插入USB蓝牙适配器.
  9. 在VirtualBox屏幕中,转至设备> USB设备.选择你的加密狗.
  10. 完成!现在你的Android VM有蓝牙.尝试打开蓝牙电源并发现/与其他设备配对.
  11. 现在剩下的就是去Eclipse,并运行你的程序.Android AVD管理器应将VM显示为列表中的设备.

我这样做了,它工作正常.但问题是,如果我使用蓝牙适配器它工作正常,但我不能使用我的笔记本电脑的内置蓝牙设备与VM机器.如何将内置蓝牙设备与VM Machine连接,如何将其用于测试基于蓝牙的应用程序.请提出一些想法.提前致谢..

android virtualbox bluetooth android-emulator android-x86

17
推荐指数
1
解决办法
3万
查看次数

KeyStore和KeyManager/TrustManager之间的区别

使用密钥库和信任库的KeyStore对象有什么区别; 而不是使用KeyManager和TrustManager?

让我解释一下我的要求.我正在使用RESTEasy,需要通过HTTPS使用SSL证书进行REST调用.我需要增加RESTEasy如何创建ClientRequest.这是我最初想到的:

public void afterPropertiesSet() throws Exception {
    Assert.isTrue(StringUtils.isNotBlank(getKeystoreName()), "Key Store Name is Blank");
    Assert.isTrue(StringUtils.isNotBlank(getKeystorePassword()), "Key Store Password is Blank.");
    Assert.isTrue(StringUtils.isNotBlank(getKeystorePath()), "Key Store Path is Blank");
    Assert.isTrue(StringUtils.isNotBlank(getTruststoreName()), "Trust Store Name is Blank");
    Assert.isTrue(StringUtils.isNotBlank(getTruststorePassword()), "Trust Store Password is Blank.");
    Assert.isTrue(StringUtils.isNotBlank(getTruststorePath()), "Trust Store Path is Blank");

    // Set the keystore and truststore for mutual authentication
    createKeystore();
    createTruststore();

    if (getHttpClient() == null) {
        // Initialize HTTP Client
        initializeHttpClient();
    }

    Assert.notNull(getHttpClient(), "HTTP Client is NULL after initialization");
}

public ClientRequest createClientRequest(String uri) throws …
Run Code Online (Sandbox Code Playgroud)

ssl keystore httpclient truststore

16
推荐指数
1
解决办法
2万
查看次数

@GeneratedValue with strategy = GenerationType.AUTO在重启后生成重复值

我有一个配置为ID的hibernate实体

@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
Run Code Online (Sandbox Code Playgroud)

第一次运行时,新元素的创建工作正常.但是,如果我重新启动我的应用程序并检索回记录,下次当我尝试持久保存此实体时,hibernate会尝试使用在未重新启动应用程序时生成的相同ID.

我收到下面的错误,当使用trace选项运行时,我能够看到ID正在被重用

*Hibernate:插入org_myEntity(entitiyJID,entitityName,id)值(?,?,?)org.hibernate.util.JDBCExceptionReporter
SQL错误:20000,SQLState:23505 org.hibernate.util.JDBCExceptionReporter语句已中止,因为它会已在"TABLE_NAME"上定义的"SQL120725164357680"标识的唯一或主键约束或唯一索引中导致重复键值.org.hibernate.event.def.AbstractFlushingEventListener
无法与会话同步数据库状态org.hibernate.exception.ConstraintViolationException:无法*

顺便说一句,我使用的是hibernate 3.3.2.GA,javax.persistance 2.0.0和Derby 10.5.1数据库

有人知道我这一代可能出现什么问题,我该如何解决?

annotations hibernate id-generation

10
推荐指数
1
解决办法
3万
查看次数

下拉菜单未显示在Bootstrap中

我正试图在Bootstrap中获得一个基本的下拉菜单:

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
  </head>
  <body>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="js/bootstrap.min.js"></script>

    <div class="dropdown">
      <!-- Link or button to toggle dropdown -->
      <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
        <li><a tabindex="-1" href="#">Action</a></li>
        <li><a tabindex="-1" href="#">Another action</a></li>
        <li><a tabindex="-1" href="#">Something else here</a></li>
        <li class="divider"></li>
        <li><a tabindex="-1" href="#">Separated link</a></li>
      </ul>
    </div>

  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

然而,没有任何表现.我知道正确引用了本地CSS和JS文件.据我所知,默认的JS包含所有插件.

编辑:感谢大家的反馈.我只能添加,以防人们发现自己处于相同的情况,在复制和粘贴代码段之前,在教程中进一步向下移动.

twitter-bootstrap twitter-bootstrap-2

9
推荐指数
1
解决办法
4万
查看次数

ActiveMQ简单身份验证插件 - 用户管理员无权创建:topic://ActiveMQ.Advisory.Connection

我修改了我们的ActiveMQ配置,使用ActiveMQ Simple Authentication Plugin,其中包含一个拥有代理所有权限的用户和密码

    <plugins>
        <simpleAuthenticationPlugin>
            <users>
                    <authenticationUser
                    username="admin"
                    password="pass"
                    groups="admins,publishers,consumers" />
            </users>
        </simpleAuthenticationPlugin>
     <authorizationPlugin>
          <map>
              <authorizationMap>
                  <authorizationEntries>
                      <authorizationEntry queue=">" write="producers" read="consumers" admin="admins" />
                  </authorizationEntries>
              </authorizationMap>
          </map>
      </authorizationPlugin>

    </plugins>
Run Code Online (Sandbox Code Playgroud)

我的java Web应用程序之前通过调用createConnection()而没有任何参数来创建ActiveMQConnectionFactory的实例.

    connection = (ActiveMQConnection)connectionFactory.createConnection();
Run Code Online (Sandbox Code Playgroud)

我修改了我的代码,将我的ActiveMQ Simple Authentication Plugin配置中定义的用户名和密码字符串传递给createConnection()方法的重载版本

    String username = "admin";
    String password = "pass";
    connection = (ActiveMQConnection)connectionFactory.createConnection(username, password);
Run Code Online (Sandbox Code Playgroud)

我能够干净地编译我的代码,但在部署时收到'用户无法创建主题'错误

    10:51:03,831 ERROR [stderr] (MSC service thread 1-11) javax.jms.JMSException: User admin is not authorized to create: topic://ActiveMQ.Advisory.Connection
    10:51:03,832 ERROR [stderr] (MSC service thread 1-11)   at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
    10:51:03,832 ERROR [stderr] (MSC …
Run Code Online (Sandbox Code Playgroud)

java activemq-classic

8
推荐指数
1
解决办法
1万
查看次数

如何在OS X上检查硬件BLE支持?

我在这里读到,2011年中期的Apple电脑应该支持BLE(低功耗蓝牙).有没有办法(可能使用命令行)检查设备和操作系统是否支持BLE?

macos bluetooth-lowenergy

7
推荐指数
2
解决办法
3239
查看次数