You are not logged in.

turkulainen

Beginner

  • "turkulainen" is male
  • "turkulainen" started this thread

Posts: 20

Date of registration: Jun 30th 2009

Location: Turku, Finland

Occupation: engineer

  • Send private message

1

Thursday, July 2nd 2009, 12:48pm

Could not find the main class: Module1. Program will exit

This is my first attempt to write a small code doing Text1.Text = "Yes" and Label1.Caption = "asdfjk" in response to Command1_Click. But I can't even get to see the Form on the screen as a window. In VB, we have to specify where the program should start. In Jabaco, I could not figure out, and the result is the error of not finding the Sub Main. Is there something I have to add to Module1? Thanks.

I will later try to take in three or four VB6 forms with 4 modules, and see how far I manage. I know I will have to change the Open and Close commands for the files, but hopefully not much else.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Friday, July 3rd 2009, 12:11am

Hi,
if you create a new SDI Application project in Jabaco, you automatically get a Form1 and a Module1.

Content of Module1 by default:

Source code

1
2
3
4
5
6
7
8
Public Form1 As New Form1

Public Sub main(ByJava args() As String)
   Dim myArgs() As String
   myArgs = args
   Form1.SetDefaultClose()
   Form1.show()
End Sub


Content of Form1 for a little test:

Source code

1
2
3
Public Sub Command1_Click()
   msgbox "hello world!"
End Sub


I have absolutely no clue what could have gone wrong in your first step.
The missing main indicates that something is wrong with your Module1.
Main is necessary as a starting point for your application.

Please give it another try. It usually takes seconds to hack in such a small sample.

Success!

A1880

turkulainen

Beginner

  • "turkulainen" is male
  • "turkulainen" started this thread

Posts: 20

Date of registration: Jun 30th 2009

Location: Turku, Finland

Occupation: engineer

  • Send private message

3

Friday, July 3rd 2009, 8:53am

These files were there. I even tried the samples. The problem seems to be with Java, as I mentioned in another thread.

How does Jabaco know where Java sits on my machine?

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

4

Friday, July 3rd 2009, 11:21am

Hi,
on my Windows PC, I have no references to Java in environment variables like JAVA_HOME or PATH.
So, Jabaco seems to take the Windows registry as pointer to the current Java installation.

On my system:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.6"
"BrowserJavaVersion"="1.6.0_10"
"Java6FamilyVersion"="1.6.0_10"

...

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6]
"JavaHome"="C:\\Programme\\Java\\jre6"
"RuntimeLib"="C:\\Programme\\Java\\jre6\\bin\\client\\jvm.dll"
"MicroVersion"="0"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_10]
"JavaHome"="C:\\Programme\\Java\\jre6"
"MicroVersion"="0"
"RuntimeLib"="C:\\Programme\\Java\\jre6\\bin\\client\\jvm.dll"


It might help to download and install a fresh JRE 1.6 on your system.
I don't know if setting JAVA_HOME and PATH would be of any help.

Best regards

A1880

turkulainen

Beginner

  • "turkulainen" is male
  • "turkulainen" started this thread

Posts: 20

Date of registration: Jun 30th 2009

Location: Turku, Finland

Occupation: engineer

  • Send private message

5

Friday, July 3rd 2009, 12:04pm

I downloaded Java one more time, but it did not help. I downloaded from www.java.com, and it was quite large.
Now I suspect I should have downloaded from http://java.sun.com/javase/downloads/index.jsp. Which is the right place to download JRE 1.6? Since I know nothing about Java, I couldn't easily distinguish between JRE and the development kit.

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

6

Friday, July 3rd 2009, 12:20pm

Hi turkulainen,

keep calm 8)
let's solve it step by step:
* first we should verify that Java is installed properly on your PC

go to the windows control panel, is there a Java-Icon?

if yes, can you start it (double click it)?

regards
OlimilO
OlimilO has attached the following image:
  • JavaIcon.png

turkulainen

Beginner

  • "turkulainen" is male
  • "turkulainen" started this thread

Posts: 20

Date of registration: Jun 30th 2009

Location: Turku, Finland

Occupation: engineer

  • Send private message

7

Friday, July 3rd 2009, 1:54pm

Yes, Java is visible in the control panel (says Java (TM) Control Panel) and I could start it by double clicking. It results in a small window with various setting options: General, Update, Java, Security and Advanced. On the General page, there are About...; Network Settings...; Settings...; and View... for temporary Internet files.

turkulainen

Beginner

  • "turkulainen" is male
  • "turkulainen" started this thread

Posts: 20

Date of registration: Jun 30th 2009

Location: Turku, Finland

Occupation: engineer

  • Send private message

8

Friday, July 3rd 2009, 2:10pm

Some more information:

When I try to run a project, on the left side at the bottom on black background I get

*** JDWP-Connection established...
Start ...
Java HotSpot(TM) Client VM 1.6.0_14
--- Console closed in 6 sec.




On the right side at the bottom on black background I get

Listening for transport dt_shmem at address: Jabaco68127531x219
java.lang.NoClassDefFoundError: VBLoader
Caused by: java.lang.ClassNotFoundException: VBLoader
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)


I can compile it to an *.exe anyway.

Does this say something?

Manuel

Administrator

  • "Manuel" is male

Posts: 256

Date of registration: Jul 16th 2008

Location: Erlangen, Germany

Occupation: Software Developer

Hobbies: Jabaco, game theory, text-mining

  • Send private message

9

Friday, July 3rd 2009, 7:50pm

Next version will fix this problem.

Rate this thread
WoltLab Burning Board