 |
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|
 |
0 down vote favorite
on my ubuntu terminal i was trying to compile and run the program like this
javac -cp "/usr/lib/jvm/jdk1.8.0_20/lib/gs-core-1.2.jar" GraphExplore.java
successfully compiled.now to run
java -cp "/usr/lib/jvm/jdk1.8.0_20/lib/gs-core-1.2.jar" GraphExplore
I got error saying
Error: Could not find or load main class GraphExplore
I am newbee in java.please someone help me to resovle this issue.thanks in advance.what i tried to resolve this error.i kept .class file in one folder and run i mean i kept in one path and tried to execute in that path only but it didnt work.please help me
|
|
|
|
 |
You need to show us where, in your program, the main method is.
|
|
|
|
 |
import org.graphstream.graph.*;
import org.graphstream.graph.implementations.*;
import java.util.Iterator;
public class GraphExplore {
public static void main(String args[]) {
new GraphExplore();
}
public GraphExplore() {
Graph graph = new SingleGraph("tutorial 1");
graph.addAttribute("ui.stylesheet", styleSheet);
graph.setAutoCreate(true);
graph.setStrict(false);
graph.display();
graph.addEdge("AB", "A", "B");
graph.addEdge("BC", "B", "C");
graph.addEdge("CA", "C", "A");
graph.addEdge("AD", "A", "D");
graph.addEdge("DE", "D", "E");
graph.addEdge("DF", "D", "F");
graph.addEdge("EF", "E", "F");
for (Node node : graph) {
node.addAttribute("ui.label", node.getId());
}
explore(graph.getNode("A"));
}
public void explore(Node source) {
Iterator<? extends Node> k = source.getBreadthFirstIterator();
while (k.hasNext()) {
Node next = k.next();
next.setAttribute("ui.class", "marked");
sleep();
}
}
protected void sleep() {
try { Thread.sleep(1000); } catch (Exception e) {}
}
protected String styleSheet =
"node {" +
" fill-color: black;" +
"}" +
"node.marked {" +
" fill-color: red;" +
"}";
}
|
|
|
|
 |
Strange, I cannot see anything wrong with your code. Are you sure that the compilation worked successfully and the class file exists in the directory where you are calling the java command from?
|
|
|
|
|
 |
Hello all,
I'm a .net developer.
I have a project that I might get into.
The thing is, the servers are WebLogic.
I don't know a lot on this subject so I wanted to know if I can deploy my asp.NET application on that server (or what I have to do for that)
Thanks for any help
|
|
|
|
|
 |
I know it's an ASP.NET application question but since it's also related to Java, I thought that here is also a relevant place to ask. But I'll try there.
|
|
|
|
 |
There is nothing Java related in your question.
|
|
|
|
 |
WebLogic is an Oracle server for running Java apps.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
OP's question still has nothing to do with Java programming.
|
|
|
|
 |
True. But I don't see a better place to put it on CP.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
It belongs in Q&A; or Hosting & Servers, it has nothing to do with Java.
|
|
|
|
 |
ThetaClear wrote: so I wanted to know if I can deploy my asp.NET application on that server (or what I have to do for that)
In general - no.
There are specialized instances such as writing a proxy or running a command line app but I doubt that is what you had in mind.
|
|
|
|
 |
Hi everyone,
I am trying to connect Oracle database from my web application using Eclipse.
But I got the error:org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection;
I used below code:
public static void initDB(){
try {
BasicDataSource ds = new BasicDataSource();
ds.setDriverClassName("oracle.jdbc.driver.OracleDriver");
ds.setUrl("jdbc:oracle:thin:@localhost:1521:xe");
ds.setUsername("mybank");
ds.setPassword("123456");
jdbcTemplate = new JdbcTemplate(ds); isConnected = true;
initSystemPros();
} catch (Exception e) {
System.err.println("Cannot connect to DataBase");
isConnected = false;
}
}
I tried to use SQL Developer to create a connection using above settings and successful.
Do you know what is wrong ?
Thanks and regards,
Tai
|
|
|
|
 |
can you please tell me the code for adding smileys in client server chatting program in java.
|
|
|
|
 |
There is no such code. You need to design some smileys for yourself, and write the code in the server and client that handles them.
|
|
|
|
 |
Hello there fellow java users,
I'm dealing with some situations with Java Eclipse, I was writing the codes for a public class related to 'books". basically using instance data for the author, publisher, copy right date, etc. I feel like I've got all the correct codes and everything but I feel as if I've stumbled onto a certain error that I can't fix. Every-time I try to run the program the console output says: book[Java Application] C:\Program Files (x86)\Java\jre7\bin\javaw.exe.
I don't know what I did wrong, if anybody can help me that would be great. Here are the codes i wrote:
package book;
public class book {
public static void main(String[] args){
}
private String title;
private String author;
private String publisher;
private int copyRightDate;
public book(String authorName, String publisher, String author, String year22) {
title = getTitle();
author = getAuthor();
publisher = getPublisher();
copyRightDate = year2();
}
private int year2() {
return 0;
}
public book(String authorName, String publisher2, String author2,
int year32) {
}
public book()
{
author = "Ridley Pearson";
title = "Kingdom Keepers";
publisher = "Disney";
}
public void setAuthor(String authorName) {
author = authorName; }
public String getAuthor() {
return author; }
public void setTitle(String bookTitle) {
title = bookTitle; }
public String getTitle() {
return title; }
public void setPublisher(String publisherName) {
publisher = publisherName; }
public String getPublisher() {
return publisher;}
public void setCopyRightDate(int date) {
copyRightDate = date; }
public int getCopyRightDate() {
return copyRightDate; }
public String toString() {
return (title + "\t" + author + "\t" + publisher + "\t" + copyRightDate);}
public class bookshelf{
}
public void main1(String[] args) {
}
final int year2 = 2010;
final int year3 = 2011;
{
}
{
new book ("Kingdom Keepers III\n", "Disney In Shadow\n", "Ridley Pearson\n", year2);
new book("Kingdom Keepers IV\n", "Power Play\n", "Ridley Pearson\n", year3);
System.out.println("Kingdom Keepers III");
System.out.println("Kingdom Keepers IV");
}
}
Andrew Besbekos
Computer Science Student
|
|
|
|
 |
Your main method has no body, so it never does anything.
|
|
|
|
 |
so what is he supposed to do???
|
|
|
|
|
 |
hello, Im having a trouble on how to read the Mifare card using Java smartcardio.
For now, I write a code that can only read the apdu of the card. hope i can help from you guys, thanks
package nfctry;
import javax.swing.*;
import java.util.*;
import javax.smartcardio.*;
import javax.swing.JOptionPane;
public class NFCr {
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
public static String bytesToHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
int v;
for ( int j = 0; j < bytes.length; j++ ) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
public static void main(String[] args) throws Exception {
TerminalFactory factory = TerminalFactory.getInstance("PC/SC",null);
System.out.println(factory);
List<CardTerminal> terminals = factory.terminals().list();
System.out.println("Terminals: " + terminals);
if (terminals.isEmpty()) {
throw new Exception("No card terminals available");
}
CardTerminal terminal = terminals.get(0);
while( true )
{
terminal.waitForCardPresent( 0 );
try {
Card card = terminal.connect("*");
CardChannel channel = card.getBasicChannel();
CommandAPDU command = new CommandAPDU(new byte[]{(byte)0xFF,(byte)0xCA,(byte)0x00,(byte)0x00,(byte)0x04});
ResponseAPDU response = channel.transmit(command);
byte[] byteArray = response.getBytes();
System.out.println(bytesToHex( byteArray ) );
Thread.sleep(1000);
} catch (CardException e) {
e.printStackTrace();
} finally {
}
}
}
}
|
|
|
|
|
 |
the question is,
how can I read the data that contain in the tag (mifare). Since i didn't find any solution regarding my problems. I need to know how to read mifare card.
|
|
|
|
 |