java代码有bug,在eclipse上可以运行,在oj系统上就有错误,但是只能运行一部分

![图片说明](https://img-ask.csdn.net/upload/201811/07/1541569581_852187.jpg)<br>
图片说明

import java.util.*;

class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int N = sc.nextInt();
MultiValueMap stringMultiValueMap = new LinkedMultiValueMap<>();
while (N-- > 0) {
String id = sc.next();
String time = sc.next();
stringMultiValueMap.add(id, time);

        }
        Set<String> keySet = stringMultiValueMap.keySet();
        for (String key : keySet) {
            List<String> values = stringMultiValueMap.getValues(key);
            if (values.size() < 6)
                continue;
            ArrayList<Integer> total_times = new ArrayList<>();
            for (String value : values) {
                int h = Integer.parseInt(value.substring(0, 2));
                int d = Integer.parseInt(value.substring(3, 5));
                int s = Integer.parseInt(value.substring(6, 8));
                int total_time = h * 3600 + d * 60 + s;
                total_times.add(total_time);
            }
            Collections.sort(total_times);
            if (check(total_times))
                System.out.println(key);
        }
    }
}

private static boolean check(ArrayList<Integer> list) {
    for (int i = 0; i <= list.size() - 6; i++) {
        for (int j = i + 1; j < i + 6; j++) {
            if (Math.abs(list.get(i) - list.get(j)) >= 3600)
                return false;
        }
    }
    return true;
}

}

interface MultiValueMap {
void add(K key, V value);

void add(K key, List<V> values);

void set(K key, V value);

void set(K key, List<V> values);

void set(Map<K, List<V>> values);

List<V> remove(K key);

void clear();

Set<K> keySet();

List<V> values();

V getValue(K key, int index);

List<V> getValues(K key);

int size();

boolean isEmpty();

boolean containsKey(K key);

}

class LinkedMultiValueMap implements MultiValueMap {
protected Map> mSource = new LinkedHashMap>();

public LinkedMultiValueMap() {
}

@Override
public void add(K key, V value) {
    if (key != null) {
        if (!mSource.containsKey(key))
            mSource.put(key, new ArrayList<V>(2));
        mSource.get(key).add(value);
    }
}

@Override
public void add(K key, List<V> values) {
    for (V value : values) {
        add(key, value);
    }
}

@Override
public void set(K key, V value) {
    mSource.remove(key);
    add(key, value);
}

@Override
public void set(K key, List<V> values) {
    mSource.remove(key);
    add(key, values);
}

@Override
public void set(Map<K, List<V>> map) {
    mSource.clear();
    mSource.putAll(map);
}

@Override
public List<V> remove(K key) {
    return mSource.remove(key);
}

@Override
public void clear() {
    mSource.clear();
}

@Override
public Set<K> keySet() {
    return mSource.keySet();
}

@Override
public List<V> values() {
    List<V> allValues = new ArrayList<V>();
    Set<K> keySet = mSource.keySet();
    for (K key : keySet) {
        allValues.addAll(mSource.get(key));
    }
    return allValues;
}

@Override
public List<V> getValues(K key) {
    return mSource.get(key);
}

@Override
public V getValue(K key, int index) {
    List<V> values = mSource.get(key);
    if (values != null && index < values.size())
        return values.get(index);
    return null;
}

@Override
public int size() {
    return mSource.size();
}

@Override
public boolean isEmpty() {
    return mSource.isEmpty();
}

@Override
public boolean containsKey(K key) {
    return mSource.containsKey(key);
}

}

0

1个回答

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
VS上可以运行,Eclipse上不能
C++程序,vs上可以运行,Eclipse上报一个变量没定义,明明就定义了。(Android.mk文件没问题的)
在eclipse上运行html文件
在eclipse上是可以运行html文件的,比如说我想这个html文件   可以鼠标右键单击,找到 open with ,然后选择      然后选择 web browser ,这样就会直接跳转到浏览器打开页面了。    欢迎大家采纳,如有疑问可以在下面评论或者关注我的博客发消息给我。        ...
在linux上运行eclipse
在linux上运行eclipsern我写了个脚本eclipse.sh放在/usr/local/bin目录下rn内容如下:rnexport JAVA_HOME=/usr/java/j2sdk1.4.2_10rnexport CLASSPATH=/usr/java/j2sdk1.4.2_10/librn/eclipse/eclipse -vm /usr/java/j2sdk1.4.2_10/bin/java -date ~/workspace &rn然后输入shell命令:rn/usr/local/bin/eclipse.shrn报错:rn/usr/local/bin/eclipse.sh:line2:export:'/eclipse/eclipse':not a valid identifierrn/usr/local/bin/eclipse.sh:line2:export:'-vm':not a valid identifierrn/usr/local/bin/eclipse.sh:line2:export:'/usr/java/j2sdk1.4.2_10/bin/java':not a valid identifierrn/usr/local/bin/eclipse.sh:line2:export:'-date':not a valid identifierrn/usr/local/bin/eclipse.sh:line2:export:'/root/workspace':not a valid identifierrnrn请问该怎么解决?谢谢
编译没有报错,但是运行就有错误.
编译没有报错,但是运行就有错误.我是照着孙鑫教程打的代码.代码如下rn[code=C/C++]rn#include rn#include rnLRESULT CALLBACK WinSunProc(rn HWND hwnd, // handle to windowrn UINT uMsg, // message identifierrn WPARAM wParam, // first message parameterrn LPARAM lParam // second message parameterrn );rnint WINAPI WinMain(rn HINSTANCE hInstance, // handle to current instancern HINSTANCE hPrevInstance, // handle to previous instancern LPSTR lpCmdLine, // command linern int nCmdShow // show statern )rnrn WNDCLASS wndclass;rn wndclass.cbClsExtra = 0;rn wndclass.cbWndExtra = 0;rn wndclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);rn wndclass.hCursor = LoadCursor(NULL,IDC_APPSTARTING);rn wndclass.hIcon = LoadIcon(NULL,IDI_APPLICATION);rn wndclass.hInstance = hInstance;rn wndclass.lpfnWndProc = WinSunProc;rn wndclass.lpszClassName = "first window";rn wndclass.lpszMenuName = NULL;rn wndclass.style = CS_HREDRAW | CS_VREDRAW;rn RegisterClass(&wndclass);rn HWND hwnd;rn hwnd = CreateWindow("first window","第一个c++窗口",WS_OVERLAPPEDWINDOW/*具有最小化框,rn 最大化框,标题栏菜单栏*/,100,50,rn 800,600,NULL,NULL,hInstance,NULL);rn ShowWindow(hwnd,SW_SHOWNORMAL);rn UpdateWindow(hwnd);rn MSG msg;rn while (GetMessage(&msg,NULL,0,0));rn rn TranslateMessage(&msg);rn DispatchMessage(&msg);rn rn return 0;rnrnrnLRESULT CALLBACK WinSunProc(rn HWND hwnd, // handle to windowrn UINT uMsg, // message identifierrn WPARAM wParam, // first message parameterrn LPARAM lParam // second message parameterrn )rnrn switch (uMsg)rn rn case WM_CHAR:rn char szchar[20];rn sprintf(szchar,"%d",wParam);rn MessageBox(hwnd,szchar,"测试字符串",0);rn break;rn case WM_LBUTTONDOWN:rn MessageBox(hwnd,"鼠标点击","测试鼠标点击事件",0);rn HDC hdc;rn hdc = GetDC(hwnd);rn TextOut(hdc,CW_USEDEFAULT,CW_USEDEFAULT,"单击鼠标输出文字事件",strlen("单击鼠标输出文字事件"));rn ReleaseDC(hwnd,hdc);rn break;rn case WM_PAINT:rn HDC hdc1;rn PAINTSTRUCT ps;rn hdc1 = BeginPaint(hwnd,&ps);rn TextOut(hdc1,CW_USEDEFAULT,CW_USEDEFAULT,"PAINT事件",strlen("PAINT事件"));rn EndPaint(hwnd,&ps);rn break; rn case WM_CLOSE:rn if (IDYES == MessageBox(hwnd,"要退出吗?","退出标题",MB_OKCANCEL))rn DestroyWindow(hwnd);rn break;rn case WM_DESTROY:rn PostQuitMessage(0);rn break;rn default :rn return DefWindowProc(hwnd,uMsg,wParam,lParam);rn rn return 0;rn;[/code]
系统能运行,但是上网上不了。
大家好!这里有一个这样的问题:就是电脑系统能运行,但是上网上不了,rnrn提示错误:windows sock Initialize fail 请大家指教怎么样解决,是什么原因
eclipse运行java代码的原理
问题我们知道使用javac和java可以手工的执行java代码,那么为什么eclipse可以直接运行了,eclipse为什么做了什么?分析1、我们在eclipse中创建一个项目的时候,eclipse会让我们选定某个jdk,一般来说eclipse会自带有jdk 2、如果我们想要我们创建的项目使用我们自己本机的jdk,那么首先需要如下配置,然后我们在创建项目的时候,就可以选择我们自己的jdk了。 3
在本地运行正常,上传到服务器后就有BUG
不知道各友有没有遇到这样的问题,在本地一切正常,但是传到服务器上后就出现BUG了。rn比如一个搜索功能,在本地正常,但是使用域名访问的时候,要是搜索阿奇霉素分散片搜不出,但是搜索阿奇霉素分散却行的。数据是存在视图里面的。
【分布式集群】hadoop2.6.0在eclipse上的运行和命令行运行
环境配置: jdk1.7.0_80 hadoop-2.6.0 eclipse-jee-mars-R-linux-gtk.tar.gz(官网下的目前为止最新的吧) hadoop2x-eclipse-plugin-master(hadoop在eclipse上的插件,网上一搜一大把) 安装eclipse,解压即可 tar -xvf eclipse-jee-mars-R-linux-g
在干净的98上可以运行,但仍然有用户反馈有错误。
在干净的98上可以运行,但仍然有用户反馈有错误。rnrn说是“Activex 部件不能创建对象”rnrn开发环境:vb6.0 + win98/2000rn安装制作:install shield6.3rn数据库技术:ado2.5rnrn哪位大虾帮帮忙。
在vs2005运行正常,但是部署到iis上就有问题了?
[img=E:\QQ20110607164833.gif][/img]rnrnServer Error in '/salesb' Application.rnrnCannot access the system temp folder. Please, make sure your application have Full Control rights on that folder or check rnRadUpload help --> Configuration --> RadUploadHttpModulernrnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. rnrnException Details: System.IO.IOException: Cannot access the system temp folder. Please, make sure your application have Full Control rights on that folder or check rnRadUpload help --> Configuration --> RadUploadHttpModulernrnSource Error: rnrnAn unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.rnrnStack Trace: rnrnrn[IOException: Cannot access the system temp folder. Please, make sure your application have Full Control rights on that folder or check rnRadUpload help --> Configuration --> RadUploadHttpModule]rn Telerik.WebControls.RadUploadUtils.IO.PathHelper.CreateTempFileName() +103rn Telerik.WebControls.RadUploadUtils.RequestEntity.CreateFileBodyWriter() +14rn Telerik.WebControls.RadUploadUtils.RequestEntity..ctor(String rawHeaders, Encoding encoding, TextBodyWriter textWriter) +511rn Telerik.WebControls.RadUploadUtils.RequestParser.WriteProcessedPart(Int32 start, Int32 end) +310rn Telerik.WebControls.RadUploadUtils.RequestParser.ProcessRequest(RequestStream request) +83rn Telerik.WebControls.RadUploadHttpModule.Context_BeginRequest(Object sender, EventArgs e) +308rn System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148rn System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75rnrnrn在vs2005运行正常,但是部署到iis上就有问题了?rn 就是在excel中的数据上传到数据库中的时候,报的错
在eclipse上运行maven项目报错
将一个确定没有错误的maven项目导入eclipse后报错 错误如下 : 4. ERROR in E:\graduate\research area\lncRNA function predict\7month\fakhraei_tcbb2014-master\src\main\java\edu\umd\cs\psl\fakhraei_tcbb2014\cross_validation_tr...
eclipse上运行spark程序
最近在学spark,尝试在Windows+Eclipse运行程序,现在分享给大家 首先,你得把你要处理的文件上传带HDFS,怎么上传文件网上都有教程,此处不再赘述。 项目结构图 源代码 import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ imp...
selenium在eclipse上运行的jar包
包内包含Java兼容包和server-standalone包,打开eclipse,加进去就OK了
怎么在Eclipse上运行静态网页
最近学习关于javascript的编程,因为写java写的很多,用eclipse用的比较习惯,正好eclipse可以用来写html和javascript,所以我在elicpse下建立了一个静态网页工程Static Web Project,现在介绍下怎么在Http Preview at Localhost的本地服务器下运行静态网站。和服务器的一些配置问题。 当然首先你要安装Eclipse,有创建各
在eclipse上运行nodejs项目
第一步:    安装nodeclipse    打开Ecelipse,选择Help -&amp;gt; Eclipse Marketplace...,在Search栏下的Find框中输入nodeclipse后回车进行搜索    找到nodeclipse,点击右侧install,点开之后弹出框中插件是全选的,选择其中两个安装完成后重启eclipse即可生效第二步:   在 https://nodejs.or...
哪里有可以在2000server上运行的Pqmagic?
好象很多只能在2000个人版或XP上运行,我一直找不到可以在server上的。
IDEA加密算法在Android上运行出错,在windows上可以运行
package com.fyn.algorithm.utils; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.security.Inv
GPS地图在wince5.0上可以运行,在wince6.0上无法运行
一个国外客户发了一个国外地图过来,在wince5.0上面是可以正常运行的rn但在wice6.0上面运行时,发生严重错误,地图完全进不去。rn是什么原因造成的?
vs2010程序在win7上可以运行,在xp上不能运行
用vs2010编写的程序,在win7下运行良好,在xp下存在问题,并且已经安装Framework v4.0.30319, 请高手指点rnrn在program.cs中加上try catch 语句,捕获到如下异常:rnException has been thrown by the target of an invocationrnrnrn去掉try catch 语句,在事件查看器中看到如下信息:rnApplication: DtuServer.exernFramework Version: v4.0.30319rnDescription: The process was terminated due to an unhandled exception.rnException Info: System.Reflection.TargetInvocationExceptionrnStack:rn at System.RuntimeMethodHandle._SerializationInvoke(System.IRuntimeMethodInfo, System.Object, System.SignatureStruct ByRef, System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)rn at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(System.Object, System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)rn at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(System.Runtime.Serialization.ObjectHolder)rn at System.Runtime.Serialization.ObjectManager.DoFixups()rn at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(System.Runtime.Remoting.Messaging.HeaderHandler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)rn at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream, System.Runtime.Remoting.Messaging.HeaderHandler, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)rn at System.Resources.ResourceReader.DeserializeObject(Int32)rn at System.Resources.ResourceReader._LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)rn at System.Resources.ResourceReader.LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)rn at System.Resources.ResourceReader.LoadObject(Int32, System.Resources.ResourceTypeCode ByRef)rn at System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean, Boolean)rn at System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean)rn at System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo, Boolean)rn at System.Resources.ResourceManager.GetObject(System.String)rn at DtuServer.FormMain.InitializeComponent()rn at DtuServer.FormMain..ctor()rn at DtuServer.Program.Main()rn
在windows上可以运行的java程序移植到liunx上运行出错
这个小程序在windows平台编译成功了.并且可以运行一部分功能,也就是说程序会执行到一定的位置然后再出错,然而到linux环境下再次运行相同的class文件时,一开始程序就崩了.下面是终端的截图:rn[img=https://img-bbs.csdn.net/upload/201501/03/1420246645_266573.png][/img]rn求大神给指导一下啊.另外,两个平台的JDK的版本是相同的. 还有.这程序 在windows上编译时需要引入的那些包在linux上是没有的,但是这好像没有影响吧,我只是把class文件移植到linux上去了啊.是可执行文件啊.
在android上运行osgi错误
在Android上运行osgi。rn出现如下错误:rnWelcome to Felix.rn=================rnrnJun 17, 2009 8:09:45 AM java.io.BufferedReader rnINFO: Default buffer size used in BufferedReader constructor. It would be betterrn to be explicit if a 8k-char buffer is required.rnJun 17, 2009 8:09:45 AM java.io.BufferedWriter rnINFO: Default buffer size used in BufferedWriter constructor. It would be betterrn to be explicit if a 8k-char buffer is required.rnJun 17, 2009 8:09:45 AM java.io.BufferedWriter rnINFO: Default buffer size used in BufferedWriter constructor. It would be betterrn to be explicit if a 8k-char buffer is required.rnJun 17, 2009 8:09:45 AM java.io.BufferedWriter rnINFO: Default buffer size used in BufferedWriter constructor. It would be betterrn to be explicit if a 8k-char buffer is required.rnjava.lang.reflect.InvocationTargetExceptionrn at java.net.URLStreamHandler.toExternalForm(URLStreamHandler.java:312)rn at java.lang.reflect.Method.invokeNative(Native Method)rn at java.lang.reflect.Method.invoke(Method.java:515)rn at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalFornrm(URLHandlersStreamHandlerProxy.java:387)rn at org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalFornrm(URLHandlersStreamHandlerProxy.java:371)rn at java.net.URL.toExternalForm(URL.java:742)rn at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLrnHandlersStreamHandlerProxy.java:314)rn at java.net.URL.(URL.java:328)rn at java.net.URL.(URL.java:155)rn at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.jrnava:149)rn at org.apache.felix.framework.cache.JarRevision.(JarRevision.java:rn78)rn at org.apache.felix.framework.cache.JarRevision.(JarRevision.java:rn56)rn at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocarntion(BundleArchive.java:986)rn at org.apache.felix.framework.cache.BundleArchive.revise(BundleArchive.jrnava:614)rn at org.apache.felix.framework.cache.BundleArchive.(BundleArchive.jrnava:140)rn at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:rn158)rn at org.apache.felix.framework.Felix.installBundle(Felix.java:2066)rn at org.apache.felix.framework.Felix.installBundle(Felix.java:2026)rn at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContrnextImpl.java:130)rn at org.apache.felix.main.AutoActivator.processAutoProperties(AutoActivatrnor.java:121)rn at org.apache.felix.main.AutoActivator.start(AutoActivator.java:55)rn at org.apache.felix.framework.util.SecureAction.startActivator(SecureActrnion.java:589)rn at org.apache.felix.framework.Felix$SystemBundleActivator.start(Felix.jarnva:3905)rn at org.apache.felix.framework.util.SecureAction.startActivator(SecureActrnion.java:589)rn at org.apache.felix.framework.Felix.init(Felix.java:638)rn at org.apache.felix.framework.Felix.start(Felix.java:672)rn at org.apache.felix.main.Main.main(Main.java:213)rn at dalvik.system.NativeStart.main(Native Method)rnCaused by: java.lang.NullPointerExceptionrn ... 28 morernrn在android的源代码中rnjava.net.URLStreamHandler.toExternalForm的代码如下:rn protected String toExternalForm(URL url) rn StringBuffer answer = new StringBuffer(url.getProtocol().length() -------------------line:312rn + url.getFile().length() + 16);rn answer.append(url.getProtocol());rn answer.append(':');rn String authority = url.getAuthority();rn if (authority != null && authority.length() > 0) rn answer.append("//"); //$NON-NLS-1$rn answer.append(url.getAuthority());rn rnrn String file = url.getFile();rn String ref = url.getRef();rn // file is never nullrn answer.append(file);rn if (ref != null) rn answer.append('#');rn answer.append(ref);rn rn return answer.toString();rn rnrn谁知道是什么错误吗?
System.Speech.Recognition在XP上运行的错误
在用http://msdn2.microsoft.com/zh-cn/magazine/cc163663(en-us).aspx上的代码时,运行_recognizer.LoadGrammar(pizzaGrammar);会产生错误:rn中文:"语法的语言与语音识别器的语言不匹配。"rn英文:"The language for the grammar does not match the language of the speech recognizer"rn我上网搜过,好像只有在XP上才会显示的,请问有人知道解决方法吗?rn代码: rnusing System; rnusing System.Windows.Forms; rnusing System.ComponentModel; rnusing System.Collections.Generic; rnusing System.Speech.Recognition; rnrnnamespace speech rn rn public partial class Form1 : Form rn rn SpeechRecognizer _recognizer = new SpeechRecognizer(); rnrnrn public Form1() rn rn InitializeComponent(); rn rnrnrn private void Form1_Load(object sender, EventArgs e) rn rn Choices pizzaChoices = new Choices(); rn pizzaChoices.Add("I'd like a cheese pizza"); rn pizzaChoices.Add("I'd like a pepperoni pizza"); rn pizzaChoices.Add("I'd like a large pepperoni pizza"); rn pizzaChoices.Add("I'd like a small thin crust vegetarian pizza"); rn Grammar pizzaGrammar = new Grammar(new GrammarBuilder(pizzaChoices)); rn pizzaGrammar.SpeechRecognized += new EventHandlerPizzaGrammar_SpeechRecognized); rn _recognizer.LoadGrammar(pizzaGrammar); rn rn void PizzaGrammar_SpeechRecognized(object sender, RecognitionEventArgs e) rn rn MessageBox.Show(e.Result.Text); rn rn rn rn
自己机子上可以,到服务器就有错误!
http://www.91asp.cn/lyj/index.aspxrn怎么解决?搞定揭帖~!
软件在我的电脑上可以运行,换了就有问题
我做了一个声音分析软件从声卡采样后然后分析频率并显示出来。我的平台是WindowsXP Sp2(一直更新) + DoNet2.0(随visualC#2005安装),我的程序调用了DirectX SDk(5.1.2600.2180),在我的计算机上运行正常,但是在另一些SP2 + DoNet2.0(从微软网站上下的)计算机上不能运行请各位前辈指点。如果您对我的程序有兴趣就联系我 360573829
在Win2000上编译的程序,可以在哪些系统上运行?
在win2000专业版上编译的程序不能在98上运行,不知道可不可以在win2000服务器版 和 winXP ,win2003rn上运行,有谁知道的给详细解说一下,谢了先
Android Studio上编写运行Java代码
以前想在Android Studio测试一些Java代码,特性什么的不知到怎么弄,还得打开eclipse来运行。现在大知道两种方式。 在Junit Test中和在Java library module中。 一、Android Studio默认创建了test目录,里面有ExampleUnitTest类,可以在里面写一些简单的代码,在该目录添加其他类等,还可以添加然后右键->run xxx即可,
五子棋--java代码在eclipse中运行
在eclipse中编写的Java代码,运用了Java的图形界面工具。执行后会跳出窗口显示为棋盘,可以通过鼠标下棋,会判断输赢,也可以重新开始等等
Docker在window7系统上运行
Docker在win7、win8系统上安装,需要安装docker-tool:http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/ 我这里安装的是DockerToolbox-18.02.0-ce.exe 安装过程比较简单,下一步下一步,如果我们已经安装了Git可以在安装时不安装Git,安装成功后桌面会有3个图标 这...
有哪些编译器可以运行JAVA代码?
有哪些编译器可以运行JAVA代码?
一个存在内存泄露的程序在winNT上可以运行1天,而在Win98上只能运行1小时,原因?????
如题
eclipse web项目可以运行.jsp但是不知如何运行.java
我用eclipse创建了一个web项目,运行jsp文件没问题,但现在我要运行java文件,但是不知道如何运行,我start了一个tomcat,然后试过用Run on Server,结果没用,如下是我加入项目的java文件代码rnimport java.io.BufferedReader;rnimport java.io.DataInputStream;rnimport java.io.DataOutputStream;rnimport java.io.InputStreamReader;rnimport java.net.ServerSocket;rnimport java.net.Socket;rnrnpublic class Main rn public static final int PORT = 8888;//监听的端口号 rnrn public static void main(String[] args) rn System.out.println("服务器启动...\n");rn Main server = new Main();rn server.init();rn rnrn public void init() rn try rn ServerSocket serverSocket = new ServerSocket(PORT);rn while (true) rn // 一旦有堵塞, 则表示服务器与客户端获得了连接 rn Socket client = serverSocket.accept();rn // 处理这次连接 rn new HandlerThread(client);rn rn catch (Exception e) rn System.out.println("服务器异常: " + e.getMessage());rn rn rnrn private class HandlerThread implements Runnable rn private Socket socket;rn public HandlerThread(Socket client) rn socket = client;rn new Thread(this).start();rn rnrn public void run() rn try rn // 读取客户端数据 rn DataInputStream input = new DataInputStream(socket.getInputStream());rn String clientInputStr = input.readUTF();//这里要注意和客户端输出流的写方法对应,否则会抛 EOFExceptionrn // 处理客户端数据 rn System.out.println("客户端发过来的内容:" + clientInputStr);rnrn // 向客户端回复信息 rn DataOutputStream out = new DataOutputStream(socket.getOutputStream());rn System.out.print("请输入:\t");rn // 发送键盘输入的一行 rn String s = new BufferedReader(new InputStreamReader(System.in)).readLine();rn out.writeUTF(s);rnrn out.close();rn input.close();rn catch (Exception e) rn System.out.println("服务器 run 异常: " + e.getMessage());rn finally rn if (socket != null) rn try rn socket.close();rn catch (Exception e) rn socket = null;rn System.out.println("服务端 finally 异常:" + e.getMessage());rn rn rn rn rn rn
applet只能在有jre的机器上运行?
//HelloWorld.javarnpublic class HelloWorld rn public static void main(String[] args) rn System.out.println("HelloWorld");rn rnrn//jsp文件rnrnrn A Simple Program rnrnrnrnHere is the output of my program:rnrnrnrnrnrnrn//我把HelloWorld.java编译好之后,连同jsp文件一起放在Tomcat的发布目录下面,然后用ie访问,我发现在本机上可以有运行结果:显示HelloWorld,但是在其他机器上(没有安装jdk的机器)上,只是显示一块灰色的区域,而没有HelloWorld的字样,这是为什么?难道applet只能在有jre的机器上运行?rn
运行eclipse错误
Problems during startup. check the".lob"file in the".metadata" rndirectory of your workspace
真机可以运行但是模拟器不能运行
刚拿到手的项目,经过一番调试可以再真机上运行了,但是在模拟器上运行的时候会报如下的错误,有大神们了解的么 duplicate symbol _x_pi in:     /Users/IOS/Library/Developer/Xcode/DerivedData/AndyCoder-brqlabrvdxihyxcbghxgjyxsedcp/Build/Intermediates/Andy
Mobile 程序在 win ce 上可以运行,但是老是卡死
最新小弟公司进一批新的PDA 用的系统是 win ce7 的。领导让我将之前的程序弄到新设备上面使用,说只用调下窗口分辨率就可以了。可是我在上面运行的时候,一致是出问题。各个地方莫名奇妙的卡死。不知道我需要做什么。rnPS:我本来是做Java的 。可是PDA也要用,不得不来搞!!!
WINSOCK在装有VB的机器上可以运行,但是...........
我在ASP中用插的调用WINSOCK控件,在装有VB的机器上该ASP页面可以运行,但在没有装VB的机器上不能运行,同时该控件不能下载。如果我将WINSOCK控件rn拷贝到机器上注册,也不行。请教解决方法!!!!!rn
Tomcat上运行不了,但是HTML可以,求解!
请问一下这是因为Tomcat设置问题还是路径问题,或是其他?[img=https://img-bbs.csdn.net/upload/201612/22/1482408884_617957.jpg][/img][img=https://img-bbs.csdn.net/upload/201612/22/1482409082_972201.jpg][/img][img=https://img-bbs.csdn.net/upload/201612/22/1482409093_546451.jpg][/img]
在Eclipse运行Java代码,但是控制台不输出内容
在Eclipse运行Java代码,但是控制台不输出内容,也没有报异常
在eclipse上搭建mapreduce开发环境及运行wordcount
1.先说明我的实验环境: win7, eclipse版本是Neon.2 Release (4.6.2), hadoop2.7.3部署在1master,3slave的集群上 2.需要下载winutils.exe和hadoop-eclipse-plugin-2.7.3.jar,下载地址是点击打开链接 3.找到eclipse根目录下的plugins目录,将下载好的hadoop-eclipse-
在eclipse上运行安卓源码的时候报错
学习开发安卓的时候,在eclipse运行网上下载的源码的时候提示如下报错,实在是不知道怎么办了,请各位帮帮忙rnrn[2013-12-11 21:38:04 - MediaPlayerProject] Unable to resolve target 'android-4'rn[2013-12-11 21:38:24 - MediaPlayerProject] ------------------------------rn[2013-12-11 21:38:24 - MediaPlayerProject] Android Launch!rn[2013-12-11 21:38:24 - MediaPlayerProject] The connection to adb is down, and a severe error has occured.rn[2013-12-11 21:38:24 - MediaPlayerProject] You must restart adb and Eclipse.rn[2013-12-11 21:38:24 - MediaPlayerProject] Please ensure that adb is correctly located at 'C:\Users\571864\android-sdks\platform-tools\adb.exe' and can be executed.rn
相关热词 c# 线程顺序 c#昨天当前时间 c# 多进程 锁 c#mysql图片存取 c# ocx 委托事件 c# 读取类的属性和值 c# out 使用限制 c#获取url的id c#怎么进行分页查询 c# update 集合